@atlaskit/editor-plugin-annotation 19.0.2 → 19.1.0
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
|
+
## 19.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e1e5846272124`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1e5846272124) -
|
|
8
|
+
Expose `applyInlineCommentDraft` and `removeInlineCommentAnnotation` so consumers can apply and
|
|
9
|
+
roll back inline-comment drafts without the annotation manager.
|
|
10
|
+
|
|
11
|
+
## 19.0.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 19.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -9,6 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _annotation = require("@atlaskit/adf-schema/annotation");
|
|
12
13
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
13
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
15
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
@@ -24,7 +25,7 @@ var _toolbarComponents = require("./ui/toolbar-components");
|
|
|
24
25
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
27
|
var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref) {
|
|
27
|
-
var _api$featureFlags, _api$
|
|
28
|
+
var _api$featureFlags, _api$analytics3;
|
|
28
29
|
var annotationProviders = _ref.config,
|
|
29
30
|
api = _ref.api;
|
|
30
31
|
var featureFlags = api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
@@ -94,7 +95,15 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
94
95
|
hasAnyUnResolvedAnnotationInPage: _utils.hasAnyUnResolvedAnnotationInPage,
|
|
95
96
|
requestCloseInlineComment: requestCloseInlineComment,
|
|
96
97
|
stripNonExistingAnnotations: _utils.stripNonExistingAnnotations,
|
|
97
|
-
|
|
98
|
+
applyInlineCommentDraft: function applyInlineCommentDraft(annotationId) {
|
|
99
|
+
var _api$analytics;
|
|
100
|
+
return (0, _editorCommands.createAnnotation)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, api)(annotationId, _annotation.AnnotationTypes.INLINE_COMMENT, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes);
|
|
101
|
+
},
|
|
102
|
+
removeInlineCommentAnnotation: function removeInlineCommentAnnotation(annotationId) {
|
|
103
|
+
var _api$analytics2, _annotationProviders$;
|
|
104
|
+
return (0, _editorCommands.removeInlineCommentFromDoc)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(annotationId, (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : []);
|
|
105
|
+
},
|
|
106
|
+
setInlineCommentDraftState: (0, _editorCommands.setInlineCommentDraftState)(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
98
107
|
showCommentForBlockNode: (0, _editorCommands.showInlineCommentForBlockNode)(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
99
108
|
setSelectedAnnotation: _editorCommands.setSelectedAnnotation,
|
|
100
109
|
setPendingSelectedAnnotation: _editorCommands.setPendingSelectedAnnotation
|
|
@@ -114,11 +123,11 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
114
123
|
plugin: function plugin(_ref4) {
|
|
115
124
|
var dispatch = _ref4.dispatch;
|
|
116
125
|
if (annotationProviders) {
|
|
117
|
-
var _api$
|
|
126
|
+
var _api$analytics4;
|
|
118
127
|
return (0, _inlineComment.inlineCommentPlugin)({
|
|
119
128
|
dispatch: dispatch,
|
|
120
129
|
provider: annotationProviders.inlineComment,
|
|
121
|
-
editorAnalyticsAPI: api === null || api === void 0 || (_api$
|
|
130
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
122
131
|
featureFlagsPluginState: featureFlags,
|
|
123
132
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
124
133
|
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
@@ -158,13 +167,13 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
158
167
|
}
|
|
159
168
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
160
169
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
161
|
-
var _api$
|
|
162
|
-
var _annotationProviders$ = annotationProviders.inlineComment,
|
|
163
|
-
isToolbarAbove = _annotationProviders
|
|
164
|
-
onCommentButtonMount = _annotationProviders
|
|
165
|
-
getCanAddComments = _annotationProviders
|
|
166
|
-
contentType = _annotationProviders
|
|
167
|
-
var toolbarConfig = (0, _toolbar.buildToolbar)(api === null || api === void 0 || (_api$
|
|
170
|
+
var _api$analytics5;
|
|
171
|
+
var _annotationProviders$2 = annotationProviders.inlineComment,
|
|
172
|
+
isToolbarAbove = _annotationProviders$2.isToolbarAbove,
|
|
173
|
+
onCommentButtonMount = _annotationProviders$2.onCommentButtonMount,
|
|
174
|
+
getCanAddComments = _annotationProviders$2.getCanAddComments,
|
|
175
|
+
contentType = _annotationProviders$2.contentType;
|
|
176
|
+
var toolbarConfig = (0, _toolbar.buildToolbar)(api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)({
|
|
168
177
|
state: state,
|
|
169
178
|
intl: intl,
|
|
170
179
|
isToolbarAbove: isToolbarAbove,
|
|
@@ -209,7 +218,7 @@ var selector = function selector(states) {
|
|
|
209
218
|
};
|
|
210
219
|
};
|
|
211
220
|
function AnnotationContentComponent(_ref6) {
|
|
212
|
-
var _api$
|
|
221
|
+
var _api$analytics6;
|
|
213
222
|
var api = _ref6.api,
|
|
214
223
|
editorView = _ref6.editorView,
|
|
215
224
|
annotationProviders = _ref6.annotationProviders,
|
|
@@ -226,7 +235,7 @@ function AnnotationContentComponent(_ref6) {
|
|
|
226
235
|
providers: annotationProviders,
|
|
227
236
|
editorView: editorView,
|
|
228
237
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
229
|
-
editorAnalyticsAPI: api === null || api === void 0 || (_api$
|
|
238
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions,
|
|
230
239
|
editorAPI: api
|
|
231
240
|
}));
|
|
232
241
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
|
|
2
3
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
|
-
import { setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
|
|
6
|
+
import { createAnnotation, removeInlineCommentFromDoc, setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
|
|
6
7
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
7
8
|
import { inlineCommentPlugin } from './pm-plugins/inline-comment';
|
|
8
9
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
@@ -15,7 +16,7 @@ export const annotationPlugin = ({
|
|
|
15
16
|
config: annotationProviders,
|
|
16
17
|
api
|
|
17
18
|
}) => {
|
|
18
|
-
var _api$featureFlags, _api$
|
|
19
|
+
var _api$featureFlags, _api$analytics3;
|
|
19
20
|
const featureFlags = api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
20
21
|
const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
21
22
|
/**
|
|
@@ -62,7 +63,15 @@ export const annotationPlugin = ({
|
|
|
62
63
|
hasAnyUnResolvedAnnotationInPage,
|
|
63
64
|
requestCloseInlineComment,
|
|
64
65
|
stripNonExistingAnnotations,
|
|
65
|
-
|
|
66
|
+
applyInlineCommentDraft: annotationId => {
|
|
67
|
+
var _api$analytics;
|
|
68
|
+
return createAnnotation(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, api)(annotationId, AnnotationTypes.INLINE_COMMENT, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes);
|
|
69
|
+
},
|
|
70
|
+
removeInlineCommentAnnotation: annotationId => {
|
|
71
|
+
var _api$analytics2, _annotationProviders$;
|
|
72
|
+
return removeInlineCommentFromDoc(api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(annotationId, (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : []);
|
|
73
|
+
},
|
|
74
|
+
setInlineCommentDraftState: setInlineCommentDraftState(api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
66
75
|
showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
67
76
|
setSelectedAnnotation,
|
|
68
77
|
setPendingSelectedAnnotation
|
|
@@ -82,11 +91,11 @@ export const annotationPlugin = ({
|
|
|
82
91
|
dispatch
|
|
83
92
|
}) => {
|
|
84
93
|
if (annotationProviders) {
|
|
85
|
-
var _api$
|
|
94
|
+
var _api$analytics4;
|
|
86
95
|
return inlineCommentPlugin({
|
|
87
96
|
dispatch,
|
|
88
97
|
provider: annotationProviders.inlineComment,
|
|
89
|
-
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$
|
|
98
|
+
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
90
99
|
featureFlagsPluginState: featureFlags,
|
|
91
100
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
92
101
|
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
@@ -125,14 +134,14 @@ export const annotationPlugin = ({
|
|
|
125
134
|
}
|
|
126
135
|
const pluginState = getPluginState(state);
|
|
127
136
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
128
|
-
var _api$
|
|
137
|
+
var _api$analytics5;
|
|
129
138
|
const {
|
|
130
139
|
isToolbarAbove,
|
|
131
140
|
onCommentButtonMount,
|
|
132
141
|
getCanAddComments,
|
|
133
142
|
contentType
|
|
134
143
|
} = annotationProviders.inlineComment;
|
|
135
|
-
const toolbarConfig = buildToolbar(api === null || api === void 0 ? void 0 : (_api$
|
|
144
|
+
const toolbarConfig = buildToolbar(api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)({
|
|
136
145
|
state,
|
|
137
146
|
intl,
|
|
138
147
|
isToolbarAbove,
|
|
@@ -184,7 +193,7 @@ function AnnotationContentComponent({
|
|
|
184
193
|
annotationProviders,
|
|
185
194
|
dispatchAnalyticsEvent
|
|
186
195
|
}) {
|
|
187
|
-
var _api$
|
|
196
|
+
var _api$analytics6;
|
|
188
197
|
const annotationState = useSharedPluginStateWithSelector(api, ['annotation'], selector);
|
|
189
198
|
|
|
190
199
|
// need to explicitly check for false as undefined is also a valid value to continue
|
|
@@ -197,7 +206,7 @@ function AnnotationContentComponent({
|
|
|
197
206
|
providers: annotationProviders,
|
|
198
207
|
editorView: editorView,
|
|
199
208
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
200
|
-
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$
|
|
209
|
+
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions,
|
|
201
210
|
editorAPI: api
|
|
202
211
|
}));
|
|
203
212
|
}
|
|
@@ -4,10 +4,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
|
|
7
8
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
8
9
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
10
|
-
import { setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
|
|
11
|
+
import { createAnnotation, removeInlineCommentFromDoc, setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
|
|
11
12
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
12
13
|
import { inlineCommentPlugin } from './pm-plugins/inline-comment';
|
|
13
14
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
@@ -17,7 +18,7 @@ import { getPluginState, hasAnyUnResolvedAnnotationInPage, inlineCommentPluginKe
|
|
|
17
18
|
import { InlineCommentView } from './ui/InlineCommentView';
|
|
18
19
|
import { getToolbarComponents } from './ui/toolbar-components';
|
|
19
20
|
export var annotationPlugin = function annotationPlugin(_ref) {
|
|
20
|
-
var _api$featureFlags, _api$
|
|
21
|
+
var _api$featureFlags, _api$analytics3;
|
|
21
22
|
var annotationProviders = _ref.config,
|
|
22
23
|
api = _ref.api;
|
|
23
24
|
var featureFlags = api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
@@ -87,7 +88,15 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
87
88
|
hasAnyUnResolvedAnnotationInPage: hasAnyUnResolvedAnnotationInPage,
|
|
88
89
|
requestCloseInlineComment: requestCloseInlineComment,
|
|
89
90
|
stripNonExistingAnnotations: stripNonExistingAnnotations,
|
|
90
|
-
|
|
91
|
+
applyInlineCommentDraft: function applyInlineCommentDraft(annotationId) {
|
|
92
|
+
var _api$analytics;
|
|
93
|
+
return createAnnotation(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, api)(annotationId, AnnotationTypes.INLINE_COMMENT, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes);
|
|
94
|
+
},
|
|
95
|
+
removeInlineCommentAnnotation: function removeInlineCommentAnnotation(annotationId) {
|
|
96
|
+
var _api$analytics2, _annotationProviders$;
|
|
97
|
+
return removeInlineCommentFromDoc(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)(annotationId, (_annotationProviders$ = annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes) !== null && _annotationProviders$ !== void 0 ? _annotationProviders$ : []);
|
|
98
|
+
},
|
|
99
|
+
setInlineCommentDraftState: setInlineCommentDraftState(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
91
100
|
showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
|
|
92
101
|
setSelectedAnnotation: setSelectedAnnotation,
|
|
93
102
|
setPendingSelectedAnnotation: setPendingSelectedAnnotation
|
|
@@ -107,11 +116,11 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
107
116
|
plugin: function plugin(_ref4) {
|
|
108
117
|
var dispatch = _ref4.dispatch;
|
|
109
118
|
if (annotationProviders) {
|
|
110
|
-
var _api$
|
|
119
|
+
var _api$analytics4;
|
|
111
120
|
return inlineCommentPlugin({
|
|
112
121
|
dispatch: dispatch,
|
|
113
122
|
provider: annotationProviders.inlineComment,
|
|
114
|
-
editorAnalyticsAPI: api === null || api === void 0 || (_api$
|
|
123
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions,
|
|
115
124
|
featureFlagsPluginState: featureFlags,
|
|
116
125
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
117
126
|
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
@@ -151,13 +160,13 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
151
160
|
}
|
|
152
161
|
var pluginState = getPluginState(state);
|
|
153
162
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
154
|
-
var _api$
|
|
155
|
-
var _annotationProviders$ = annotationProviders.inlineComment,
|
|
156
|
-
isToolbarAbove = _annotationProviders
|
|
157
|
-
onCommentButtonMount = _annotationProviders
|
|
158
|
-
getCanAddComments = _annotationProviders
|
|
159
|
-
contentType = _annotationProviders
|
|
160
|
-
var toolbarConfig = buildToolbar(api === null || api === void 0 || (_api$
|
|
163
|
+
var _api$analytics5;
|
|
164
|
+
var _annotationProviders$2 = annotationProviders.inlineComment,
|
|
165
|
+
isToolbarAbove = _annotationProviders$2.isToolbarAbove,
|
|
166
|
+
onCommentButtonMount = _annotationProviders$2.onCommentButtonMount,
|
|
167
|
+
getCanAddComments = _annotationProviders$2.getCanAddComments,
|
|
168
|
+
contentType = _annotationProviders$2.contentType;
|
|
169
|
+
var toolbarConfig = buildToolbar(api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)({
|
|
161
170
|
state: state,
|
|
162
171
|
intl: intl,
|
|
163
172
|
isToolbarAbove: isToolbarAbove,
|
|
@@ -202,7 +211,7 @@ var selector = function selector(states) {
|
|
|
202
211
|
};
|
|
203
212
|
};
|
|
204
213
|
function AnnotationContentComponent(_ref6) {
|
|
205
|
-
var _api$
|
|
214
|
+
var _api$analytics6;
|
|
206
215
|
var api = _ref6.api,
|
|
207
216
|
editorView = _ref6.editorView,
|
|
208
217
|
annotationProviders = _ref6.annotationProviders,
|
|
@@ -219,7 +228,7 @@ function AnnotationContentComponent(_ref6) {
|
|
|
219
228
|
providers: annotationProviders,
|
|
220
229
|
editorView: editorView,
|
|
221
230
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
222
|
-
editorAnalyticsAPI: api === null || api === void 0 || (_api$
|
|
231
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions,
|
|
223
232
|
editorAPI: api
|
|
224
233
|
}));
|
|
225
234
|
}
|
|
@@ -27,7 +27,19 @@ export type AnnotationPluginDependencies = [
|
|
|
27
27
|
export type AnnotationPluginOptions = AnnotationProviders;
|
|
28
28
|
export type AnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
29
29
|
actions: {
|
|
30
|
+
/**
|
|
31
|
+
* Applies the current inline-comment draft as an annotation mark on the
|
|
32
|
+
* bookmarked selection. Callers must start a draft first via
|
|
33
|
+
* `setInlineCommentDraftState`.
|
|
34
|
+
* @returns A command that returns true when the draft is applied.
|
|
35
|
+
*/
|
|
36
|
+
applyInlineCommentDraft: (annotationId: string) => Command;
|
|
30
37
|
hasAnyUnResolvedAnnotationInPage: (state: EditorState) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Removes an inline-comment annotation mark from the document by id.
|
|
40
|
+
* @returns A command that returns true when the remove transaction is dispatched.
|
|
41
|
+
*/
|
|
42
|
+
removeInlineCommentAnnotation: (annotationId: string) => Command;
|
|
31
43
|
/**
|
|
32
44
|
* Requests that the active inline comment or comment draft be closed.
|
|
33
45
|
* Runs the provider's close guard before closing when one is configured.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "19.0
|
|
3
|
+
"version": "19.1.0",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"atlaskit:src": "src/index.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atlaskit/adf-schema": "^57.
|
|
22
|
+
"@atlaskit/adf-schema": "^57.6.0",
|
|
23
23
|
"@atlaskit/editor-plugin-analytics": "^19.0.0",
|
|
24
24
|
"@atlaskit/editor-plugin-connectivity": "^19.0.0",
|
|
25
25
|
"@atlaskit/editor-plugin-editor-viewmode-effects": "^19.0.0",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
32
32
|
"@atlaskit/icon": "^37.7.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^202.0.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@atlaskit/editor-common": "^123.
|
|
38
|
+
"@atlaskit/editor-common": "^123.7.0",
|
|
39
39
|
"react": "^18.2.0 || ^19.2.0",
|
|
40
40
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
41
41
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|