@atlaskit/editor-plugin-annotation 7.0.4 → 7.1.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.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/pm-plugins/plugin-factory.js +7 -2
- package/dist/cjs/pm-plugins/reducer.js +2 -6
- package/dist/es2019/pm-plugins/plugin-factory.js +7 -2
- package/dist/es2019/pm-plugins/reducer.js +1 -7
- package/dist/esm/pm-plugins/plugin-factory.js +7 -2
- package/dist/esm/pm-plugins/reducer.js +2 -6
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 7.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1398a2c3501f1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1398a2c3501f1) -
|
|
8
|
+
fix flash of resolved comments issue
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`2e81b0a120444`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e81b0a120444) -
|
|
16
|
+
Removing platform_editor_annotation_selected_annotation as a part of clean up
|
|
17
|
+
|
|
3
18
|
## 7.0.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -67,9 +67,14 @@ var createHandleDocChanged = function createHandleDocChanged() {
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
// Update annotations to match document state, preserving resolved states through delete/undo
|
|
70
|
+
// Only include annotations that have a known resolved state - don't default new annotations to false
|
|
71
|
+
// as this would cause them to briefly appear as unresolved before the provider sets their actual state
|
|
70
72
|
annotationIdsInDocument.forEach(function (id) {
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
+
var _prevPluginState$anno;
|
|
74
|
+
var knownState = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id];
|
|
75
|
+
if (knownState !== undefined) {
|
|
76
|
+
updatedAnnotations[id] = knownState;
|
|
77
|
+
}
|
|
73
78
|
});
|
|
74
79
|
return _objectSpread(_objectSpread({}, updatedState), {}, {
|
|
75
80
|
annotations: updatedAnnotations
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _types = require("./types");
|
|
13
12
|
var _utils = require("./utils");
|
|
14
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -37,13 +36,10 @@ var _default = exports.default = function _default(pluginState, action) {
|
|
|
37
36
|
annotations: {}
|
|
38
37
|
});
|
|
39
38
|
case _types.ACTIONS.CLOSE_COMPONENT:
|
|
40
|
-
return _objectSpread(_objectSpread(
|
|
39
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
41
40
|
isInlineCommentViewClosed: true,
|
|
42
41
|
isDrafting: false,
|
|
43
|
-
isOpeningMediaCommentFromToolbar: false
|
|
44
|
-
}, (0, _platformFeatureFlags.fg)('platform_editor_annotation_selected_annotation') && {
|
|
45
|
-
selectedAnnotations: []
|
|
46
|
-
}), pluginState.isAnnotationManagerEnabled && {
|
|
42
|
+
isOpeningMediaCommentFromToolbar: false,
|
|
47
43
|
selectedAnnotations: []
|
|
48
44
|
});
|
|
49
45
|
case _types.ACTIONS.ADD_INLINE_COMMENT:
|
|
@@ -57,9 +57,14 @@ const createHandleDocChanged = () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// Update annotations to match document state, preserving resolved states through delete/undo
|
|
60
|
+
// Only include annotations that have a known resolved state - don't default new annotations to false
|
|
61
|
+
// as this would cause them to briefly appear as unresolved before the provider sets their actual state
|
|
60
62
|
annotationIdsInDocument.forEach(id => {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
+
var _prevPluginState$anno;
|
|
64
|
+
const knownState = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id];
|
|
65
|
+
if (knownState !== undefined) {
|
|
66
|
+
updatedAnnotations[id] = knownState;
|
|
67
|
+
}
|
|
63
68
|
});
|
|
64
69
|
return {
|
|
65
70
|
...updatedState,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { ACTIONS } from './types';
|
|
4
3
|
import { addDraftDecoration, resolveDraftBookmark } from './utils';
|
|
5
4
|
export default ((pluginState, action) => {
|
|
@@ -38,12 +37,7 @@ export default ((pluginState, action) => {
|
|
|
38
37
|
isInlineCommentViewClosed: true,
|
|
39
38
|
isDrafting: false,
|
|
40
39
|
isOpeningMediaCommentFromToolbar: false,
|
|
41
|
-
|
|
42
|
-
selectedAnnotations: []
|
|
43
|
-
}),
|
|
44
|
-
...(pluginState.isAnnotationManagerEnabled && {
|
|
45
|
-
selectedAnnotations: []
|
|
46
|
-
})
|
|
40
|
+
selectedAnnotations: []
|
|
47
41
|
};
|
|
48
42
|
case ACTIONS.ADD_INLINE_COMMENT:
|
|
49
43
|
const updatedPluginState = getNewDraftState(pluginState, action.data.drafting, action.data.editorState);
|
|
@@ -60,9 +60,14 @@ var createHandleDocChanged = function createHandleDocChanged() {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
// Update annotations to match document state, preserving resolved states through delete/undo
|
|
63
|
+
// Only include annotations that have a known resolved state - don't default new annotations to false
|
|
64
|
+
// as this would cause them to briefly appear as unresolved before the provider sets their actual state
|
|
63
65
|
annotationIdsInDocument.forEach(function (id) {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
+
var _prevPluginState$anno;
|
|
67
|
+
var knownState = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id];
|
|
68
|
+
if (knownState !== undefined) {
|
|
69
|
+
updatedAnnotations[id] = knownState;
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
return _objectSpread(_objectSpread({}, updatedState), {}, {
|
|
68
73
|
annotations: updatedAnnotations
|
|
@@ -3,7 +3,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { ACTIONS } from './types';
|
|
8
7
|
import { addDraftDecoration, resolveDraftBookmark } from './utils';
|
|
9
8
|
export default (function (pluginState, action) {
|
|
@@ -30,13 +29,10 @@ export default (function (pluginState, action) {
|
|
|
30
29
|
annotations: {}
|
|
31
30
|
});
|
|
32
31
|
case ACTIONS.CLOSE_COMPONENT:
|
|
33
|
-
return _objectSpread(_objectSpread(
|
|
32
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
34
33
|
isInlineCommentViewClosed: true,
|
|
35
34
|
isDrafting: false,
|
|
36
|
-
isOpeningMediaCommentFromToolbar: false
|
|
37
|
-
}, fg('platform_editor_annotation_selected_annotation') && {
|
|
38
|
-
selectedAnnotations: []
|
|
39
|
-
}), pluginState.isAnnotationManagerEnabled && {
|
|
35
|
+
isOpeningMediaCommentFromToolbar: false,
|
|
40
36
|
selectedAnnotations: []
|
|
41
37
|
});
|
|
42
38
|
case ACTIONS.ADD_INLINE_COMMENT:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@atlaskit/editor-toolbar-model": "^0.3.0",
|
|
40
40
|
"@atlaskit/icon": "^30.0.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^16.36.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^111.
|
|
47
|
+
"@atlaskit/editor-common": "^111.9.0",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0"
|
|
50
50
|
},
|
|
@@ -95,9 +95,6 @@
|
|
|
95
95
|
"editor_inline_comments_on_inline_nodes": {
|
|
96
96
|
"type": "boolean"
|
|
97
97
|
},
|
|
98
|
-
"platform_editor_annotation_selected_annotation": {
|
|
99
|
-
"type": "boolean"
|
|
100
|
-
},
|
|
101
98
|
"confluence_frontend_preload_inline_comment_editor": {
|
|
102
99
|
"type": "boolean"
|
|
103
100
|
},
|