@atlaskit/editor-plugin-annotation 2.7.6 → 2.8.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 2.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#153391](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/153391)
14
+ [`1e42cbe3dd636`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1e42cbe3dd636) -
15
+ [ux] [ED-27484] Track network state from connectivity plugin and provide this to view/create
16
+ components
17
+
3
18
  ## 2.7.6
4
19
 
5
20
  ### Patch Changes
@@ -14,6 +14,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
15
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
17
18
  var _editorCommands = require("../editor-commands");
18
19
  var _utils3 = require("../pm-plugins/utils");
19
20
  var _types = require("../types");
@@ -119,6 +120,11 @@ function InlineCommentView(_ref3) {
119
120
  dispatchAnalyticsEvent(payload);
120
121
  }
121
122
  }
123
+
124
+ // Network Status
125
+ var networkStatusSelector = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(editorAPI, 'connectivity.mode', {
126
+ disabled: (0, _experiments.editorExperiment)('platform_editor_offline_editing_web', false)
127
+ });
122
128
  if (!dom) {
123
129
  return null;
124
130
  }
@@ -157,7 +163,8 @@ function InlineCommentView(_ref3) {
157
163
  }
158
164
  },
159
165
  inlineNodeTypes: inlineNodeTypes,
160
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
166
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
167
+ isOffline: networkStatusSelector === 'offline'
161
168
  }));
162
169
  }
163
170
 
@@ -217,6 +224,7 @@ function InlineCommentView(_ref3) {
217
224
  onClose: function onClose() {
218
225
  (0, _editorCommands.closeComponent)()(editorView.state, editorView.dispatch);
219
226
  },
220
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
227
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
228
+ isOffline: networkStatusSelector === 'offline'
221
229
  }));
222
230
  }
@@ -6,6 +6,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
6
6
  import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
7
7
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
10
  import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
10
11
  import { getAllAnnotations, getAnnotationViewKey, getPluginState, getSelectionPositions } from '../pm-plugins/utils';
11
12
  import { AnnotationTestIds } from '../types';
@@ -121,6 +122,11 @@ export function InlineCommentView({
121
122
  dispatchAnalyticsEvent(payload);
122
123
  }
123
124
  }
125
+
126
+ // Network Status
127
+ const networkStatusSelector = useSharedPluginStateSelector(editorAPI, 'connectivity.mode', {
128
+ disabled: editorExperiment('platform_editor_offline_editing_web', false)
129
+ });
124
130
  if (!dom) {
125
131
  return null;
126
132
  }
@@ -159,7 +165,8 @@ export function InlineCommentView({
159
165
  }
160
166
  },
161
167
  inlineNodeTypes: inlineNodeTypes,
162
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
168
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
169
+ isOffline: networkStatusSelector === 'offline'
163
170
  }));
164
171
  }
165
172
 
@@ -213,6 +220,7 @@ export function InlineCommentView({
213
220
  onClose: () => {
214
221
  closeComponent()(editorView.state, editorView.dispatch);
215
222
  },
216
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
223
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
224
+ isOffline: networkStatusSelector === 'offline'
217
225
  }));
218
226
  }
@@ -7,6 +7,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
7
7
  import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
8
8
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
11
12
  import { getAllAnnotations, getAnnotationViewKey, getPluginState, getSelectionPositions } from '../pm-plugins/utils';
12
13
  import { AnnotationTestIds } from '../types';
@@ -112,6 +113,11 @@ export function InlineCommentView(_ref3) {
112
113
  dispatchAnalyticsEvent(payload);
113
114
  }
114
115
  }
116
+
117
+ // Network Status
118
+ var networkStatusSelector = useSharedPluginStateSelector(editorAPI, 'connectivity.mode', {
119
+ disabled: editorExperiment('platform_editor_offline_editing_web', false)
120
+ });
115
121
  if (!dom) {
116
122
  return null;
117
123
  }
@@ -150,7 +156,8 @@ export function InlineCommentView(_ref3) {
150
156
  }
151
157
  },
152
158
  inlineNodeTypes: inlineNodeTypes,
153
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
159
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
160
+ isOffline: networkStatusSelector === 'offline'
154
161
  }));
155
162
  }
156
163
 
@@ -210,6 +217,7 @@ export function InlineCommentView(_ref3) {
210
217
  onClose: function onClose() {
211
218
  closeComponent()(editorView.state, editorView.dispatch);
212
219
  },
213
- isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar
220
+ isOpeningMediaCommentFromToolbar: isOpeningMediaCommentFromToolbar,
221
+ isOffline: networkStatusSelector === 'offline'
214
222
  }));
215
223
  }
@@ -29,6 +29,10 @@ type AnnotationComponentProps = {
29
29
  * Indicates that a draft comment was discarded/cancelled
30
30
  */
31
31
  onClose?: () => void;
32
+ /**
33
+ * Indicates whether the comment UI is offline and should be disabled
34
+ */
35
+ isOffline?: boolean;
32
36
  };
33
37
  export type InlineCommentCreateComponentProps = AnnotationComponentProps & {
34
38
  /**
@@ -29,6 +29,10 @@ type AnnotationComponentProps = {
29
29
  * Indicates that a draft comment was discarded/cancelled
30
30
  */
31
31
  onClose?: () => void;
32
+ /**
33
+ * Indicates whether the comment UI is offline and should be disabled
34
+ */
35
+ isOffline?: boolean;
32
36
  };
33
37
  export type InlineCommentCreateComponentProps = AnnotationComponentProps & {
34
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "2.7.6",
3
+ "version": "2.8.1",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^47.6.0",
35
35
  "@atlaskit/analytics-next": "^11.0.0",
36
- "@atlaskit/editor-common": "^104.1.0",
36
+ "@atlaskit/editor-common": "^105.0.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
38
38
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode-effects": "^2.0.0",