@atlaskit/editor-plugin-annotation 6.2.2 → 6.2.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,21 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 6.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`28ba94dae8f9a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28ba94dae8f9a) -
8
+ [ux] EDITOR-2458 Replace usage of \_\_suppressAllToolbars with userIntentPlugin
9
+ - Updated dependencies
10
+
11
+ ## 6.2.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`21fe79119fe74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21fe79119fe74) -
16
+ EDITOR-2447 Bump adf-schema to 51.3.2
17
+ - Updated dependencies
18
+
3
19
  ## 6.2.2
4
20
 
5
21
  ### Patch Changes
@@ -90,7 +90,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
90
90
  state: state,
91
91
  bookmark: bookmark
92
92
  })) {
93
- return (0, _toolbar.buildSuppressedToolbar)(state);
93
+ return (0, _toolbar.buildSuppressedToolbar)(state, api);
94
94
  }
95
95
  },
96
96
  selectionToolbar: function selectionToolbar(state, intl) {
@@ -13,6 +13,7 @@ var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
17
  var _editorCommands = require("../editor-commands");
17
18
  var _types = require("../types");
18
19
  var _utils2 = require("./utils");
@@ -48,12 +49,13 @@ var shouldSuppressFloatingToolbar = exports.shouldSuppressFloatingToolbar = func
48
49
  var isSelectionMatchingBookmark = resolvedBookmark.to === tr.selection.to && resolvedBookmark.from === tr.selection.from;
49
50
  return isSelectionMatchingBookmark;
50
51
  };
51
- var buildSuppressedToolbar = exports.buildSuppressedToolbar = function buildSuppressedToolbar(state) {
52
+ var buildSuppressedToolbar = exports.buildSuppressedToolbar = function buildSuppressedToolbar(state, api) {
53
+ var userIntentEnabled = Boolean((api === null || api === void 0 ? void 0 : api.userIntent) && (0, _expValEquals.expValEquals)('platform_editor_lovability_user_intent', 'isEnabled', true));
52
54
  return {
53
55
  items: [],
54
56
  nodeType: getValidNodes(state),
55
57
  title: 'Annotation suppressed toolbar',
56
- __suppressAllToolbars: true
58
+ __suppressAllToolbars: userIntentEnabled ? undefined : true
57
59
  };
58
60
  };
59
61
  var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsAPI) {
@@ -80,7 +80,7 @@ export const annotationPlugin = ({
80
80
  state,
81
81
  bookmark
82
82
  })) {
83
- return buildSuppressedToolbar(state);
83
+ return buildSuppressedToolbar(state, api);
84
84
  }
85
85
  },
86
86
  selectionToolbar(state, intl) {
@@ -6,6 +6,7 @@ import { annotationMessages } from '@atlaskit/editor-common/messages';
6
6
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
7
7
  import CommentIcon from '@atlaskit/icon/core/comment';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { setInlineCommentDraftState } from '../editor-commands';
10
11
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
11
12
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
@@ -48,12 +49,13 @@ export const shouldSuppressFloatingToolbar = ({
48
49
  const isSelectionMatchingBookmark = resolvedBookmark.to === tr.selection.to && resolvedBookmark.from === tr.selection.from;
49
50
  return isSelectionMatchingBookmark;
50
51
  };
51
- export const buildSuppressedToolbar = state => {
52
+ export const buildSuppressedToolbar = (state, api) => {
53
+ const userIntentEnabled = Boolean((api === null || api === void 0 ? void 0 : api.userIntent) && expValEquals('platform_editor_lovability_user_intent', 'isEnabled', true));
52
54
  return {
53
55
  items: [],
54
56
  nodeType: getValidNodes(state),
55
57
  title: 'Annotation suppressed toolbar',
56
- __suppressAllToolbars: true
58
+ __suppressAllToolbars: userIntentEnabled ? undefined : true
57
59
  };
58
60
  };
59
61
  export const buildToolbar = editorAnalyticsAPI => ({
@@ -83,7 +83,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
83
83
  state: state,
84
84
  bookmark: bookmark
85
85
  })) {
86
- return buildSuppressedToolbar(state);
86
+ return buildSuppressedToolbar(state, api);
87
87
  }
88
88
  },
89
89
  selectionToolbar: function selectionToolbar(state, intl) {
@@ -6,6 +6,7 @@ import { annotationMessages } from '@atlaskit/editor-common/messages';
6
6
  import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
7
7
  import CommentIcon from '@atlaskit/icon/core/comment';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { setInlineCommentDraftState } from '../editor-commands';
10
11
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
11
12
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
@@ -41,12 +42,13 @@ export var shouldSuppressFloatingToolbar = function shouldSuppressFloatingToolba
41
42
  var isSelectionMatchingBookmark = resolvedBookmark.to === tr.selection.to && resolvedBookmark.from === tr.selection.from;
42
43
  return isSelectionMatchingBookmark;
43
44
  };
44
- export var buildSuppressedToolbar = function buildSuppressedToolbar(state) {
45
+ export var buildSuppressedToolbar = function buildSuppressedToolbar(state, api) {
46
+ var userIntentEnabled = Boolean((api === null || api === void 0 ? void 0 : api.userIntent) && expValEquals('platform_editor_lovability_user_intent', 'isEnabled', true));
45
47
  return {
46
48
  items: [],
47
49
  nodeType: getValidNodes(state),
48
50
  title: 'Annotation suppressed toolbar',
49
- __suppressAllToolbars: true
51
+ __suppressAllToolbars: userIntentEnabled ? undefined : true
50
52
  };
51
53
  };
52
54
  export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
@@ -35,11 +35,11 @@ type ShouldSuppressFloatingToolbarOptions = {
35
35
  * @example
36
36
  */
37
37
  export declare const shouldSuppressFloatingToolbar: ({ state, bookmark, }: ShouldSuppressFloatingToolbarOptions) => boolean;
38
- export declare const buildSuppressedToolbar: (state: EditorState) => {
38
+ export declare const buildSuppressedToolbar: (state: EditorState, api?: ExtractInjectionAPI<AnnotationPlugin>) => {
39
39
  items: never[];
40
40
  nodeType: NodeType[];
41
41
  title: string;
42
- __suppressAllToolbars: boolean;
42
+ __suppressAllToolbars: boolean | undefined;
43
43
  };
44
44
  export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, onCommentButtonMount, getCanAddComments, contentType, }: BuildToolbarOptions) => {
45
45
  items: FloatingToolbarButton<Command>[];
@@ -35,11 +35,11 @@ type ShouldSuppressFloatingToolbarOptions = {
35
35
  * @example
36
36
  */
37
37
  export declare const shouldSuppressFloatingToolbar: ({ state, bookmark, }: ShouldSuppressFloatingToolbarOptions) => boolean;
38
- export declare const buildSuppressedToolbar: (state: EditorState) => {
38
+ export declare const buildSuppressedToolbar: (state: EditorState, api?: ExtractInjectionAPI<AnnotationPlugin>) => {
39
39
  items: never[];
40
40
  nodeType: NodeType[];
41
41
  title: string;
42
- __suppressAllToolbars: boolean;
42
+ __suppressAllToolbars: boolean | undefined;
43
43
  };
44
44
  export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, onCommentButtonMount, getCanAddComments, contentType, }: BuildToolbarOptions) => {
45
45
  items: FloatingToolbarButton<Command>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "6.2.2",
3
+ "version": "6.2.4",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,7 +27,7 @@
27
27
  "sideEffects": false,
28
28
  "atlaskit:src": "src/index.ts",
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^51.3.1",
30
+ "@atlaskit/adf-schema": "^51.3.2",
31
31
  "@atlaskit/analytics-next": "^11.1.0",
32
32
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
33
33
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
@@ -41,12 +41,12 @@
41
41
  "@atlaskit/icon": "^28.5.0",
42
42
  "@atlaskit/onboarding": "^14.4.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
- "@atlaskit/tmp-editor-statsig": "^13.18.0",
44
+ "@atlaskit/tmp-editor-statsig": "^13.21.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "react-intl-next": "npm:react-intl@^5.18.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^110.18.0",
49
+ "@atlaskit/editor-common": "^110.19.0",
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },