@atlaskit/editor-plugin-annotation 6.2.3 → 6.2.5
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 +16 -0
- package/dist/cjs/annotationPlugin.js +1 -1
- package/dist/cjs/pm-plugins/toolbar.js +4 -2
- package/dist/cjs/ui/CommentButton/CommentButton.js +15 -32
- package/dist/es2019/annotationPlugin.js +1 -1
- package/dist/es2019/pm-plugins/toolbar.js +4 -2
- package/dist/es2019/ui/CommentButton/CommentButton.js +12 -30
- package/dist/esm/annotationPlugin.js +1 -1
- package/dist/esm/pm-plugins/toolbar.js +4 -2
- package/dist/esm/ui/CommentButton/CommentButton.js +15 -32
- package/dist/types/pm-plugins/toolbar.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/toolbar.d.ts +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 6.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`351b338797ae4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/351b338797ae4) -
|
|
8
|
+
ED-29460 Clean up platform_editor_toolbar_aifc_fix_editor_view
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.2.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`28ba94dae8f9a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28ba94dae8f9a) -
|
|
16
|
+
[ux] EDITOR-2458 Replace usage of \_\_suppressAllToolbars with userIntentPlugin
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.2.3
|
|
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) {
|
|
@@ -13,7 +13,6 @@ var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
|
13
13
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _utils = require("../../pm-plugins/utils");
|
|
18
17
|
var _types = require("../../types");
|
|
19
18
|
var _hooks = require("./hooks");
|
|
@@ -26,19 +25,12 @@ var CommentButton = exports.CommentButton = function CommentButton(_ref) {
|
|
|
26
25
|
var bookmark = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'annotation.bookmark');
|
|
27
26
|
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
28
27
|
editorView = _useEditorToolbar.editorView;
|
|
29
|
-
|
|
30
|
-
var _ref2 =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
state = _ref2.state,
|
|
35
|
-
dispatch = _ref2.dispatch;
|
|
36
|
-
var annotationSelectionType = state ? (0, _utils.isSelectionValid)(state) : _types.AnnotationSelectionType.INVALID;
|
|
37
|
-
var _ref3 = (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : {},
|
|
38
|
-
getCanAddComments = _ref3.getCanAddComments,
|
|
39
|
-
contentType = _ref3.contentType;
|
|
28
|
+
var annotationSelectionType = editorView !== null && editorView !== void 0 && editorView.state ? (0, _utils.isSelectionValid)(editorView.state) : _types.AnnotationSelectionType.INVALID;
|
|
29
|
+
var _ref2 = (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : {},
|
|
30
|
+
getCanAddComments = _ref2.getCanAddComments,
|
|
31
|
+
contentType = _ref2.contentType;
|
|
40
32
|
(0, _hooks.useCommentButtonMount)({
|
|
41
|
-
state:
|
|
33
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
42
34
|
annotationProviders: annotationProviders,
|
|
43
35
|
api: api,
|
|
44
36
|
annotationSelectionType: annotationSelectionType,
|
|
@@ -46,43 +38,34 @@ var CommentButton = exports.CommentButton = function CommentButton(_ref) {
|
|
|
46
38
|
});
|
|
47
39
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
48
40
|
var onClick = function onClick() {
|
|
49
|
-
if (!api || !
|
|
41
|
+
if (!api || !annotationProviders || !(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
50
42
|
return;
|
|
51
43
|
}
|
|
52
44
|
(0, _utils2.fireOnClickAnalyticsEvent)({
|
|
53
45
|
api: api
|
|
54
46
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
62
|
-
} else {
|
|
63
|
-
(0, _utils2.startCommentExperience)({
|
|
64
|
-
annotationProviders: annotationProviders,
|
|
65
|
-
api: api,
|
|
66
|
-
state: state,
|
|
67
|
-
dispatch: dispatch
|
|
68
|
-
});
|
|
69
|
-
}
|
|
47
|
+
(0, _utils2.startCommentExperience)({
|
|
48
|
+
annotationProviders: annotationProviders,
|
|
49
|
+
api: api,
|
|
50
|
+
state: editorView.state,
|
|
51
|
+
dispatch: editorView.dispatch
|
|
52
|
+
});
|
|
70
53
|
};
|
|
71
54
|
if (!(0, _utils2.shouldShowCommentButton)({
|
|
72
|
-
state:
|
|
55
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
73
56
|
isVisible: isVisible,
|
|
74
57
|
annotationSelectionType: annotationSelectionType
|
|
75
58
|
})) {
|
|
76
59
|
return null;
|
|
77
60
|
}
|
|
78
|
-
var canAddComments =
|
|
61
|
+
var canAddComments = getCanAddComments ? getCanAddComments() : true;
|
|
79
62
|
var commentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
80
63
|
var commentDisabledMessage = intl.formatMessage((0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes') ? _messages.annotationMessages.createCommentDisabled : _messages.annotationMessages.createCommentInvalid);
|
|
81
64
|
var noPermissionToAddCommentMessage = intl.formatMessage(_messages.annotationMessages.noPermissionToAddComment, {
|
|
82
65
|
contentType: contentType
|
|
83
66
|
});
|
|
84
67
|
var isDisabled = (0, _utils2.isButtonDisabled)({
|
|
85
|
-
state:
|
|
68
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
86
69
|
api: api,
|
|
87
70
|
canAddComments: canAddComments
|
|
88
71
|
});
|
|
@@ -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 => ({
|
|
@@ -6,7 +6,6 @@ import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
7
|
import { ToolbarButton, CommentIcon as NewCommentIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
import { isSelectionValid } from '../../pm-plugins/utils';
|
|
11
10
|
import { AnnotationSelectionType, AnnotationTestIds } from '../../types';
|
|
12
11
|
import { useCommentButtonMount } from './hooks';
|
|
@@ -21,21 +20,13 @@ export const CommentButton = ({
|
|
|
21
20
|
const {
|
|
22
21
|
editorView
|
|
23
22
|
} = useEditorToolbar();
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
state,
|
|
27
|
-
dispatch
|
|
28
|
-
} = editorView !== null && editorView !== void 0 ? editorView : {
|
|
29
|
-
state: null,
|
|
30
|
-
dispatch: null
|
|
31
|
-
};
|
|
32
|
-
const annotationSelectionType = state ? isSelectionValid(state) : AnnotationSelectionType.INVALID;
|
|
23
|
+
const annotationSelectionType = editorView !== null && editorView !== void 0 && editorView.state ? isSelectionValid(editorView.state) : AnnotationSelectionType.INVALID;
|
|
33
24
|
const {
|
|
34
25
|
getCanAddComments,
|
|
35
26
|
contentType
|
|
36
27
|
} = (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : {};
|
|
37
28
|
useCommentButtonMount({
|
|
38
|
-
state:
|
|
29
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
39
30
|
annotationProviders,
|
|
40
31
|
api,
|
|
41
32
|
annotationSelectionType,
|
|
@@ -43,43 +34,34 @@ export const CommentButton = ({
|
|
|
43
34
|
});
|
|
44
35
|
const intl = useIntl();
|
|
45
36
|
const onClick = () => {
|
|
46
|
-
if (!api || !
|
|
37
|
+
if (!api || !annotationProviders || !(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
47
38
|
return;
|
|
48
39
|
}
|
|
49
40
|
fireOnClickAnalyticsEvent({
|
|
50
41
|
api
|
|
51
42
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
} else {
|
|
60
|
-
startCommentExperience({
|
|
61
|
-
annotationProviders,
|
|
62
|
-
api,
|
|
63
|
-
state,
|
|
64
|
-
dispatch
|
|
65
|
-
});
|
|
66
|
-
}
|
|
43
|
+
startCommentExperience({
|
|
44
|
+
annotationProviders,
|
|
45
|
+
api,
|
|
46
|
+
state: editorView.state,
|
|
47
|
+
dispatch: editorView.dispatch
|
|
48
|
+
});
|
|
67
49
|
};
|
|
68
50
|
if (!shouldShowCommentButton({
|
|
69
|
-
state:
|
|
51
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
70
52
|
isVisible,
|
|
71
53
|
annotationSelectionType
|
|
72
54
|
})) {
|
|
73
55
|
return null;
|
|
74
56
|
}
|
|
75
|
-
const canAddComments =
|
|
57
|
+
const canAddComments = getCanAddComments ? getCanAddComments() : true;
|
|
76
58
|
const commentMessage = intl.formatMessage(annotationMessages.createComment);
|
|
77
59
|
const commentDisabledMessage = intl.formatMessage(fg('editor_inline_comments_on_inline_nodes') ? annotationMessages.createCommentDisabled : annotationMessages.createCommentInvalid);
|
|
78
60
|
const noPermissionToAddCommentMessage = intl.formatMessage(annotationMessages.noPermissionToAddComment, {
|
|
79
61
|
contentType
|
|
80
62
|
});
|
|
81
63
|
const isDisabled = isButtonDisabled({
|
|
82
|
-
state:
|
|
64
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
83
65
|
api,
|
|
84
66
|
canAddComments
|
|
85
67
|
});
|
|
@@ -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) {
|
|
@@ -6,7 +6,6 @@ import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
7
|
import { ToolbarButton, CommentIcon as NewCommentIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
import { isSelectionValid } from '../../pm-plugins/utils';
|
|
11
10
|
import { AnnotationSelectionType, AnnotationTestIds } from '../../types';
|
|
12
11
|
import { useCommentButtonMount } from './hooks';
|
|
@@ -19,19 +18,12 @@ export var CommentButton = function CommentButton(_ref) {
|
|
|
19
18
|
var bookmark = useSharedPluginStateSelector(api, 'annotation.bookmark');
|
|
20
19
|
var _useEditorToolbar = useEditorToolbar(),
|
|
21
20
|
editorView = _useEditorToolbar.editorView;
|
|
22
|
-
|
|
23
|
-
var _ref2 =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
state = _ref2.state,
|
|
28
|
-
dispatch = _ref2.dispatch;
|
|
29
|
-
var annotationSelectionType = state ? isSelectionValid(state) : AnnotationSelectionType.INVALID;
|
|
30
|
-
var _ref3 = (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : {},
|
|
31
|
-
getCanAddComments = _ref3.getCanAddComments,
|
|
32
|
-
contentType = _ref3.contentType;
|
|
21
|
+
var annotationSelectionType = editorView !== null && editorView !== void 0 && editorView.state ? isSelectionValid(editorView.state) : AnnotationSelectionType.INVALID;
|
|
22
|
+
var _ref2 = (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : {},
|
|
23
|
+
getCanAddComments = _ref2.getCanAddComments,
|
|
24
|
+
contentType = _ref2.contentType;
|
|
33
25
|
useCommentButtonMount({
|
|
34
|
-
state:
|
|
26
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
35
27
|
annotationProviders: annotationProviders,
|
|
36
28
|
api: api,
|
|
37
29
|
annotationSelectionType: annotationSelectionType,
|
|
@@ -39,43 +31,34 @@ export var CommentButton = function CommentButton(_ref) {
|
|
|
39
31
|
});
|
|
40
32
|
var intl = useIntl();
|
|
41
33
|
var onClick = function onClick() {
|
|
42
|
-
if (!api || !
|
|
34
|
+
if (!api || !annotationProviders || !(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
43
35
|
return;
|
|
44
36
|
}
|
|
45
37
|
fireOnClickAnalyticsEvent({
|
|
46
38
|
api: api
|
|
47
39
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
startCommentExperience({
|
|
57
|
-
annotationProviders: annotationProviders,
|
|
58
|
-
api: api,
|
|
59
|
-
state: state,
|
|
60
|
-
dispatch: dispatch
|
|
61
|
-
});
|
|
62
|
-
}
|
|
40
|
+
startCommentExperience({
|
|
41
|
+
annotationProviders: annotationProviders,
|
|
42
|
+
api: api,
|
|
43
|
+
state: editorView.state,
|
|
44
|
+
dispatch: editorView.dispatch
|
|
45
|
+
});
|
|
63
46
|
};
|
|
64
47
|
if (!shouldShowCommentButton({
|
|
65
|
-
state:
|
|
48
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
66
49
|
isVisible: isVisible,
|
|
67
50
|
annotationSelectionType: annotationSelectionType
|
|
68
51
|
})) {
|
|
69
52
|
return null;
|
|
70
53
|
}
|
|
71
|
-
var canAddComments =
|
|
54
|
+
var canAddComments = getCanAddComments ? getCanAddComments() : true;
|
|
72
55
|
var commentMessage = intl.formatMessage(annotationMessages.createComment);
|
|
73
56
|
var commentDisabledMessage = intl.formatMessage(fg('editor_inline_comments_on_inline_nodes') ? annotationMessages.createCommentDisabled : annotationMessages.createCommentInvalid);
|
|
74
57
|
var noPermissionToAddCommentMessage = intl.formatMessage(annotationMessages.noPermissionToAddComment, {
|
|
75
58
|
contentType: contentType
|
|
76
59
|
});
|
|
77
60
|
var isDisabled = isButtonDisabled({
|
|
78
|
-
state:
|
|
61
|
+
state: editorView === null || editorView === void 0 ? void 0 : editorView.state,
|
|
79
62
|
api: api,
|
|
80
63
|
canAddComments: canAddComments
|
|
81
64
|
});
|
|
@@ -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.
|
|
3
|
+
"version": "6.2.5",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.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.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^13.22.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.
|
|
49
|
+
"@atlaskit/editor-common": "^110.19.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|