@atlaskit/editor-plugin-annotation 2.1.2 → 2.1.4

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
+ ## 2.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#126126](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126126)
8
+ [`468f52001a847`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/468f52001a847) -
9
+ Tidy up contextual formatting toolbar experiment and switch to `platform_editor_controls` flag
10
+
11
+ ## 2.1.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 2.1.2
4
18
 
5
19
  ### Patch Changes
@@ -91,7 +91,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
91
91
  return undefined;
92
92
  } else {
93
93
  return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
94
- rank: (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
94
+ rank: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? 1 : undefined
95
95
  });
96
96
  }
97
97
  }
@@ -24,7 +24,7 @@ var updateInlineCommentResolvedState = exports.updateInlineCommentResolvedState
24
24
  return state;
25
25
  });
26
26
 
27
- // FIXME: https://product-fabric.atlassian.net/browse/EDF-716 -- This is nuking the scroll into view which occurs
27
+ // TODO: EDF-716 - This is nuking the scroll into view which occurs
28
28
  // when a comment is resolved. The problem is this is called when either a collab user or the current user resolves a comment.
29
29
  // and the problem is since cc is just dispatching an event through the provider to resolve the comment and this
30
30
  // is not comming via NCS, we have not way to know if this is a local or remote transaction.
@@ -14,13 +14,12 @@ var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
15
15
  var _comment2 = _interopRequireDefault(require("@atlaskit/icon/glyph/comment"));
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
17
  var _editorCommands = require("../editor-commands");
19
18
  var _types = require("../types");
20
19
  var _utils2 = require("./utils");
21
20
  var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsAPI) {
22
21
  return function (_ref) {
23
- var _api$editorViewMode, _api$connectivity;
22
+ var _api$connectivity;
24
23
  var state = _ref.state,
25
24
  intl = _ref.intl,
26
25
  _ref$isToolbarAbove = _ref.isToolbarAbove,
@@ -38,12 +37,9 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
38
37
  }
39
38
  var createCommentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
40
39
  var commentDisabledMessage = intl.formatMessage((0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') ? _messages.annotationMessages.createCommentDisabled : _messages.annotationMessages.createCommentInvalid);
41
- var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
42
40
  var createComment = {
43
41
  type: 'button',
44
- showTitle: !isViewMode && (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
45
- exposure: true
46
- }) && (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? false : true,
42
+ showTitle: true,
47
43
  disabled: selectionValid === _types.AnnotationSelectionType.DISABLED || (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode) === 'offline',
48
44
  testId: _types.AnnotationTestIds.floatingToolbarCreateButton,
49
45
  icon: _comment.default,
@@ -94,7 +90,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
94
90
  }
95
91
  return (0, _editorCommands.setInlineCommentDraftState)(editorAnalyticsAPI)(true)(state, dispatch);
96
92
  },
97
- supportsViewMode: true // TODO: MODES-3950 Clean up this floating toolbar view mode logic,
93
+ supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
98
94
  };
99
95
  var annotation = schema.marks.annotation;
100
96
  var validNodes = Object.keys(schema.nodes).reduce(function (acc, current) {
@@ -84,7 +84,7 @@ export const annotationPlugin = ({
84
84
  } else {
85
85
  return {
86
86
  ...toolbarConfig,
87
- rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
87
+ rank: editorExperiment('platform_editor_controls', 'variant1') ? 1 : undefined
88
88
  };
89
89
  }
90
90
  }
@@ -13,7 +13,7 @@ export const updateInlineCommentResolvedState = editorAnalyticsAPI => (partialNe
13
13
  };
14
14
  const allResolved = Object.values(partialNewState).every(state => state);
15
15
 
16
- // FIXME: https://product-fabric.atlassian.net/browse/EDF-716 -- This is nuking the scroll into view which occurs
16
+ // TODO: EDF-716 - This is nuking the scroll into view which occurs
17
17
  // when a comment is resolved. The problem is this is called when either a collab user or the current user resolves a comment.
18
18
  // and the problem is since cc is just dispatching an event through the provider to resolve the comment and this
19
19
  // is not comming via NCS, we have not way to know if this is a local or remote transaction.
@@ -7,7 +7,6 @@ import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHe
7
7
  import CommentIcon from '@atlaskit/icon/core/comment';
8
8
  import LegacyCommentIcon from '@atlaskit/icon/glyph/comment';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
10
  import { setInlineCommentDraftState } from '../editor-commands';
12
11
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
13
12
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
@@ -18,7 +17,7 @@ export const buildToolbar = editorAnalyticsAPI => ({
18
17
  _supportedNodes = [],
19
18
  api
20
19
  }) => {
21
- var _api$editorViewMode, _api$editorViewMode$s, _api$connectivity, _api$connectivity$sha, _api$connectivity$sha2;
20
+ var _api$connectivity, _api$connectivity$sha, _api$connectivity$sha2;
22
21
  const {
23
22
  schema
24
23
  } = state;
@@ -31,12 +30,9 @@ export const buildToolbar = editorAnalyticsAPI => ({
31
30
  }
32
31
  const createCommentMessage = intl.formatMessage(annotationMessages.createComment);
33
32
  const commentDisabledMessage = intl.formatMessage(fg('editor_inline_comments_on_inline_nodes') ? annotationMessages.createCommentDisabled : annotationMessages.createCommentInvalid);
34
- const isViewMode = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode) === 'view';
35
33
  const createComment = {
36
34
  type: 'button',
37
- showTitle: !isViewMode && editorExperiment('contextual_formatting_toolbar', true, {
38
- exposure: true
39
- }) && editorExperiment('platform_editor_controls', 'control') ? false : true,
35
+ showTitle: true,
40
36
  disabled: selectionValid === AnnotationSelectionType.DISABLED || (api === null || api === void 0 ? void 0 : (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 ? void 0 : (_api$connectivity$sha = _api$connectivity.sharedState) === null || _api$connectivity$sha === void 0 ? void 0 : (_api$connectivity$sha2 = _api$connectivity$sha.currentState()) === null || _api$connectivity$sha2 === void 0 ? void 0 : _api$connectivity$sha2.mode) === 'offline',
41
37
  testId: AnnotationTestIds.floatingToolbarCreateButton,
42
38
  icon: CommentIcon,
@@ -85,7 +81,7 @@ export const buildToolbar = editorAnalyticsAPI => ({
85
81
  }
86
82
  return setInlineCommentDraftState(editorAnalyticsAPI)(true)(state, dispatch);
87
83
  },
88
- supportsViewMode: true // TODO: MODES-3950 Clean up this floating toolbar view mode logic,
84
+ supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
89
85
  };
90
86
  const {
91
87
  annotation
@@ -84,7 +84,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
84
84
  return undefined;
85
85
  } else {
86
86
  return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
87
- rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
87
+ rank: editorExperiment('platform_editor_controls', 'variant1') ? 1 : undefined
88
88
  });
89
89
  }
90
90
  }
@@ -17,7 +17,7 @@ export var updateInlineCommentResolvedState = function updateInlineCommentResolv
17
17
  return state;
18
18
  });
19
19
 
20
- // FIXME: https://product-fabric.atlassian.net/browse/EDF-716 -- This is nuking the scroll into view which occurs
20
+ // TODO: EDF-716 - This is nuking the scroll into view which occurs
21
21
  // when a comment is resolved. The problem is this is called when either a collab user or the current user resolves a comment.
22
22
  // and the problem is since cc is just dispatching an event through the provider to resolve the comment and this
23
23
  // is not comming via NCS, we have not way to know if this is a local or remote transaction.
@@ -7,13 +7,12 @@ import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHe
7
7
  import CommentIcon from '@atlaskit/icon/core/comment';
8
8
  import LegacyCommentIcon from '@atlaskit/icon/glyph/comment';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
10
  import { setInlineCommentDraftState } from '../editor-commands';
12
11
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
13
12
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
14
13
  export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
15
14
  return function (_ref) {
16
- var _api$editorViewMode, _api$connectivity;
15
+ var _api$connectivity;
17
16
  var state = _ref.state,
18
17
  intl = _ref.intl,
19
18
  _ref$isToolbarAbove = _ref.isToolbarAbove,
@@ -31,12 +30,9 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
31
30
  }
32
31
  var createCommentMessage = intl.formatMessage(annotationMessages.createComment);
33
32
  var commentDisabledMessage = intl.formatMessage(fg('editor_inline_comments_on_inline_nodes') ? annotationMessages.createCommentDisabled : annotationMessages.createCommentInvalid);
34
- var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
35
33
  var createComment = {
36
34
  type: 'button',
37
- showTitle: !isViewMode && editorExperiment('contextual_formatting_toolbar', true, {
38
- exposure: true
39
- }) && editorExperiment('platform_editor_controls', 'control') ? false : true,
35
+ showTitle: true,
40
36
  disabled: selectionValid === AnnotationSelectionType.DISABLED || (api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode) === 'offline',
41
37
  testId: AnnotationTestIds.floatingToolbarCreateButton,
42
38
  icon: CommentIcon,
@@ -87,7 +83,7 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
87
83
  }
88
84
  return setInlineCommentDraftState(editorAnalyticsAPI)(true)(state, dispatch);
89
85
  },
90
- supportsViewMode: true // TODO: MODES-3950 Clean up this floating toolbar view mode logic,
86
+ supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
91
87
  };
92
88
  var annotation = schema.marks.annotation;
93
89
  var validNodes = Object.keys(schema.nodes).reduce(function (acc, current) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^47.6.0",
35
- "@atlaskit/editor-common": "^102.0.0",
35
+ "@atlaskit/editor-common": "^102.5.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-editor-viewmode-effects": "^2.0.0",
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.3.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
- "@atlaskit/icon": "^24.1.0",
41
+ "@atlaskit/icon": "^25.0.0",
42
42
  "@atlaskit/onboarding": "^13.0.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^3.4.0",
44
+ "@atlaskit/tmp-editor-statsig": "^3.6.0",
45
45
  "@babel/runtime": "^7.0.0"
46
46
  },
47
47
  "peerDependencies": {