@atlaskit/editor-plugin-annotation 7.1.0 → 7.1.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 7.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`1398a2c3501f1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1398a2c3501f1) -
14
+ fix flash of resolved comments issue
15
+ - Updated dependencies
16
+
3
17
  ## 7.1.0
4
18
 
5
19
  ### Minor 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 _ref, _prevPluginState$anno;
72
- updatedAnnotations[id] = (_ref = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id]) !== null && _ref !== void 0 ? _ref : false;
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
@@ -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 _ref, _prevPluginState$anno;
62
- updatedAnnotations[id] = (_ref = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id]) !== null && _ref !== void 0 ? _ref : false;
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,
@@ -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 _ref, _prevPluginState$anno;
65
- updatedAnnotations[id] = (_ref = (_prevPluginState$anno = prevPluginState.annotations[id]) !== null && _prevPluginState$anno !== void 0 ? _prevPluginState$anno : deletedAnnotationsCache[id]) !== null && _ref !== void 0 ? _ref : false;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
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.31.0",
42
+ "@atlaskit/tmp-editor-statsig": "^17.0.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.8.0",
47
+ "@atlaskit/editor-common": "^111.9.0",
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0"
50
50
  },