@atlaskit/editor-plugin-annotation 1.10.0 → 1.10.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 +14 -0
- package/dist/cjs/commands/transform.js +21 -6
- package/dist/cjs/pm-plugins/inline-comment.js +20 -4
- package/dist/cjs/utils.js +10 -2
- package/dist/es2019/commands/transform.js +18 -2
- package/dist/es2019/pm-plugins/inline-comment.js +20 -4
- package/dist/es2019/utils.js +10 -1
- package/dist/esm/commands/transform.js +17 -2
- package/dist/esm/pm-plugins/inline-comment.js +20 -4
- package/dist/esm/utils.js +11 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 1.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#109969](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109969)
|
|
8
|
+
[`52590a0b562ef`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/52590a0b562ef) -
|
|
9
|
+
ED-23690 Adds an attribute to annotation analytic events with the name of nodes inside the
|
|
10
|
+
annotation range
|
|
11
|
+
- [#109932](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109932)
|
|
12
|
+
[`a973fd903870a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a973fd903870a) -
|
|
13
|
+
ED-23649 fixes a variety of issues such as inline nodes not being fully interactive, and missing
|
|
14
|
+
selection visuals when inside an annotation.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 1.10.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -7,18 +7,20 @@ exports.default = void 0;
|
|
|
7
7
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
8
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
9
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _utils2 = require("../utils");
|
|
12
14
|
var addAnnotationMark = function addAnnotationMark(id, supportedBlockNodes) {
|
|
13
15
|
return function (transaction, state) {
|
|
14
|
-
var inlineCommentState = (0,
|
|
16
|
+
var inlineCommentState = (0, _utils2.getPluginState)(state);
|
|
15
17
|
var _ref = inlineCommentState || {},
|
|
16
18
|
bookmark = _ref.bookmark;
|
|
17
19
|
var annotationMark = state.schema.marks.annotation.create({
|
|
18
20
|
id: id,
|
|
19
21
|
type: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
|
20
22
|
});
|
|
21
|
-
var _resolveDraftBookmark = (0,
|
|
23
|
+
var _resolveDraftBookmark = (0, _utils2.resolveDraftBookmark)(state, bookmark, supportedBlockNodes),
|
|
22
24
|
from = _resolveDraftBookmark.from,
|
|
23
25
|
to = _resolveDraftBookmark.to,
|
|
24
26
|
head = _resolveDraftBookmark.head,
|
|
@@ -56,7 +58,7 @@ var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
|
56
58
|
return function (drafting) {
|
|
57
59
|
var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
58
60
|
return function (transaction, state) {
|
|
59
|
-
var draftingPayload = (0,
|
|
61
|
+
var draftingPayload = (0, _utils2.getDraftCommandAnalyticsPayload)(drafting, method)(state);
|
|
60
62
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(draftingPayload)(transaction);
|
|
61
63
|
return transaction;
|
|
62
64
|
};
|
|
@@ -64,13 +66,26 @@ var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
|
64
66
|
};
|
|
65
67
|
var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
66
68
|
return function (transaction, state) {
|
|
67
|
-
|
|
69
|
+
var analyticsEvent = {
|
|
68
70
|
action: _analytics.ACTION.INSERTED,
|
|
69
71
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
70
72
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
71
73
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
72
74
|
attributes: {}
|
|
73
|
-
}
|
|
75
|
+
};
|
|
76
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
77
|
+
var _ref2 = (0, _utils2.getPluginState)(state) || {},
|
|
78
|
+
bookmark = _ref2.bookmark;
|
|
79
|
+
|
|
80
|
+
// When this FF is removed we can move the analytics event creation inside of the
|
|
81
|
+
// attachAnalyticsEvent and get type inference for the attributes.
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
analyticsEvent.attributes.inlineNodeNames = (0, _utils.getRangeInlineNodeNames)({
|
|
84
|
+
doc: state.doc,
|
|
85
|
+
pos: (0, _utils2.resolveDraftBookmark)(state, bookmark)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(analyticsEvent)(transaction);
|
|
74
89
|
return transaction;
|
|
75
90
|
};
|
|
76
91
|
};
|
|
@@ -12,6 +12,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
14
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _commands = require("../commands");
|
|
16
17
|
var _nodeviews = require("../nodeviews");
|
|
17
18
|
var _utils = require("../utils");
|
|
@@ -248,10 +249,25 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
248
249
|
key: _utils.decorationKey.block
|
|
249
250
|
}));
|
|
250
251
|
} else {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
253
|
+
if (node.isText) {
|
|
254
|
+
focusDecorations.push(_view.Decoration.inline(pos, pos + node.nodeSize, {
|
|
255
|
+
class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected), " ").concat(isUnresolved),
|
|
256
|
+
nodeName: 'span'
|
|
257
|
+
}));
|
|
258
|
+
} else {
|
|
259
|
+
focusDecorations.push(_view.Decoration.node(pos, pos + node.nodeSize, {
|
|
260
|
+
class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected), " ").concat(isUnresolved)
|
|
261
|
+
}, {
|
|
262
|
+
key: _utils.decorationKey.block
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
focusDecorations.push(_view.Decoration.inline(pos, pos + node.nodeSize, {
|
|
267
|
+
class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected), " ").concat(isUnresolved),
|
|
268
|
+
nodeName: 'span'
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
255
271
|
}
|
|
256
272
|
}
|
|
257
273
|
});
|
package/dist/cjs/utils.js
CHANGED
|
@@ -289,6 +289,14 @@ var getDraftCommandAnalyticsPayload = exports.getDraftCommandAnalyticsPayload =
|
|
|
289
289
|
overlap: getAnnotationsInSelectionCount(state)
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
293
|
+
var _ref3 = getPluginState(state) || {},
|
|
294
|
+
bookmark = _ref3.bookmark;
|
|
295
|
+
attributes.inlineNodeNames = (0, _utils.getRangeInlineNodeNames)({
|
|
296
|
+
doc: state.doc,
|
|
297
|
+
pos: resolveDraftBookmark(state, bookmark)
|
|
298
|
+
});
|
|
299
|
+
}
|
|
292
300
|
return {
|
|
293
301
|
action: drafting ? _analytics.ACTION.OPENED : _analytics.ACTION.CLOSED,
|
|
294
302
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
@@ -303,8 +311,8 @@ var isSelectionValid = exports.isSelectionValid = function isSelectionValid(stat
|
|
|
303
311
|
var _currentMediaNodeWith;
|
|
304
312
|
var _supportedNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
305
313
|
var selection = state.selection;
|
|
306
|
-
var
|
|
307
|
-
disallowOnWhitespace =
|
|
314
|
+
var _ref4 = getPluginState(state) || {},
|
|
315
|
+
disallowOnWhitespace = _ref4.disallowOnWhitespace;
|
|
308
316
|
|
|
309
317
|
// Allow media so that it can enter draft mode
|
|
310
318
|
if (isCommentOnMediaOn && (_currentMediaNodeWith = (0, _mediaSingle.currentMediaNodeWithPos)(state)) !== null && _currentMediaNodeWith !== void 0 && _currentMediaNodeWith.node) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
4
|
+
import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
import { getDraftCommandAnalyticsPayload, getPluginState, resolveDraftBookmark } from '../utils';
|
|
6
8
|
const addAnnotationMark = (id, supportedBlockNodes) => (transaction, state) => {
|
|
7
9
|
const inlineCommentState = getPluginState(state);
|
|
@@ -48,13 +50,27 @@ const addOpenCloseAnalytics = editorAnalyticsAPI => (drafting, method = INPUT_ME
|
|
|
48
50
|
return transaction;
|
|
49
51
|
};
|
|
50
52
|
const addInsertAnalytics = editorAnalyticsAPI => (transaction, state) => {
|
|
51
|
-
|
|
53
|
+
const analyticsEvent = {
|
|
52
54
|
action: ACTION.INSERTED,
|
|
53
55
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
54
56
|
eventType: EVENT_TYPE.TRACK,
|
|
55
57
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
56
58
|
attributes: {}
|
|
57
|
-
}
|
|
59
|
+
};
|
|
60
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
61
|
+
const {
|
|
62
|
+
bookmark
|
|
63
|
+
} = getPluginState(state) || {};
|
|
64
|
+
|
|
65
|
+
// When this FF is removed we can move the analytics event creation inside of the
|
|
66
|
+
// attachAnalyticsEvent and get type inference for the attributes.
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
analyticsEvent.attributes.inlineNodeNames = getRangeInlineNodeNames({
|
|
69
|
+
doc: state.doc,
|
|
70
|
+
pos: resolveDraftBookmark(state, bookmark)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(analyticsEvent)(transaction);
|
|
58
74
|
return transaction;
|
|
59
75
|
};
|
|
60
76
|
const addResolveAnalytics = editorAnalyticsAPI => method => (transaction, state) => {
|
|
@@ -2,6 +2,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { clearDirtyMark, closeComponent, setInlineCommentsVisibility, setSelectedAnnotation, updateInlineCommentResolvedState, updateMouseState } from '../commands';
|
|
6
7
|
import { AnnotationNodeView, getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
7
8
|
import { decorationKey, getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
|
|
@@ -184,10 +185,25 @@ export const inlineCommentPlugin = options => {
|
|
|
184
185
|
key: decorationKey.block
|
|
185
186
|
}));
|
|
186
187
|
} else {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
189
|
+
if (node.isText) {
|
|
190
|
+
focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
|
|
191
|
+
class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
|
|
192
|
+
nodeName: 'span'
|
|
193
|
+
}));
|
|
194
|
+
} else {
|
|
195
|
+
focusDecorations.push(Decoration.node(pos, pos + node.nodeSize, {
|
|
196
|
+
class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`
|
|
197
|
+
}, {
|
|
198
|
+
key: decorationKey.block
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
|
|
203
|
+
class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
|
|
204
|
+
nodeName: 'span'
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
191
207
|
}
|
|
192
208
|
}
|
|
193
209
|
});
|
package/dist/es2019/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
|
|
4
4
|
import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, hasAnnotationMark, isParagraph, isText } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isParagraph, isText } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
@@ -251,6 +251,15 @@ export const getDraftCommandAnalyticsPayload = (drafting, inputMethod) => {
|
|
|
251
251
|
overlap: getAnnotationsInSelectionCount(state)
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
255
|
+
const {
|
|
256
|
+
bookmark
|
|
257
|
+
} = getPluginState(state) || {};
|
|
258
|
+
attributes.inlineNodeNames = getRangeInlineNodeNames({
|
|
259
|
+
doc: state.doc,
|
|
260
|
+
pos: resolveDraftBookmark(state, bookmark)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
254
263
|
return {
|
|
255
264
|
action: drafting ? ACTION.OPENED : ACTION.CLOSED,
|
|
256
265
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
4
|
+
import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
import { getDraftCommandAnalyticsPayload, getPluginState, resolveDraftBookmark } from '../utils';
|
|
6
8
|
var addAnnotationMark = function addAnnotationMark(id, supportedBlockNodes) {
|
|
7
9
|
return function (transaction, state) {
|
|
@@ -58,13 +60,26 @@ var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
|
58
60
|
};
|
|
59
61
|
var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
60
62
|
return function (transaction, state) {
|
|
61
|
-
|
|
63
|
+
var analyticsEvent = {
|
|
62
64
|
action: ACTION.INSERTED,
|
|
63
65
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
64
66
|
eventType: EVENT_TYPE.TRACK,
|
|
65
67
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
66
68
|
attributes: {}
|
|
67
|
-
}
|
|
69
|
+
};
|
|
70
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
71
|
+
var _ref2 = getPluginState(state) || {},
|
|
72
|
+
bookmark = _ref2.bookmark;
|
|
73
|
+
|
|
74
|
+
// When this FF is removed we can move the analytics event creation inside of the
|
|
75
|
+
// attachAnalyticsEvent and get type inference for the attributes.
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
analyticsEvent.attributes.inlineNodeNames = getRangeInlineNodeNames({
|
|
78
|
+
doc: state.doc,
|
|
79
|
+
pos: resolveDraftBookmark(state, bookmark)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(analyticsEvent)(transaction);
|
|
68
83
|
return transaction;
|
|
69
84
|
};
|
|
70
85
|
};
|
|
@@ -5,6 +5,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
|
5
5
|
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { clearDirtyMark, closeComponent, setInlineCommentsVisibility, setSelectedAnnotation, updateInlineCommentResolvedState, updateMouseState } from '../commands';
|
|
9
10
|
import { AnnotationNodeView, getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
10
11
|
import { decorationKey, getAllAnnotations, getPluginState, inlineCommentPluginKey } from '../utils';
|
|
@@ -241,10 +242,25 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
|
|
|
241
242
|
key: decorationKey.block
|
|
242
243
|
}));
|
|
243
244
|
} else {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
246
|
+
if (node.isText) {
|
|
247
|
+
focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
|
|
248
|
+
class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved),
|
|
249
|
+
nodeName: 'span'
|
|
250
|
+
}));
|
|
251
|
+
} else {
|
|
252
|
+
focusDecorations.push(Decoration.node(pos, pos + node.nodeSize, {
|
|
253
|
+
class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved)
|
|
254
|
+
}, {
|
|
255
|
+
key: decorationKey.block
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
|
|
260
|
+
class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved),
|
|
261
|
+
nodeName: 'span'
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
248
264
|
}
|
|
249
265
|
}
|
|
250
266
|
});
|
package/dist/esm/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
|
|
4
4
|
import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, hasAnnotationMark, isParagraph, isText } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isParagraph, isText } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
@@ -262,6 +262,14 @@ export var getDraftCommandAnalyticsPayload = function getDraftCommandAnalyticsPa
|
|
|
262
262
|
overlap: getAnnotationsInSelectionCount(state)
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes-round-2_ctuxz')) {
|
|
266
|
+
var _ref3 = getPluginState(state) || {},
|
|
267
|
+
bookmark = _ref3.bookmark;
|
|
268
|
+
attributes.inlineNodeNames = getRangeInlineNodeNames({
|
|
269
|
+
doc: state.doc,
|
|
270
|
+
pos: resolveDraftBookmark(state, bookmark)
|
|
271
|
+
});
|
|
272
|
+
}
|
|
265
273
|
return {
|
|
266
274
|
action: drafting ? ACTION.OPENED : ACTION.CLOSED,
|
|
267
275
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
@@ -276,8 +284,8 @@ export var isSelectionValid = function isSelectionValid(state, isCommentOnMediaO
|
|
|
276
284
|
var _currentMediaNodeWith;
|
|
277
285
|
var _supportedNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
278
286
|
var selection = state.selection;
|
|
279
|
-
var
|
|
280
|
-
disallowOnWhitespace =
|
|
287
|
+
var _ref4 = getPluginState(state) || {},
|
|
288
|
+
disallowOnWhitespace = _ref4.disallowOnWhitespace;
|
|
281
289
|
|
|
282
290
|
// Allow media so that it can enter draft mode
|
|
283
291
|
if (isCommentOnMediaOn && (_currentMediaNodeWith = currentMediaNodeWithPos(state)) !== null && _currentMediaNodeWith !== void 0 && _currentMediaNodeWith.node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.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
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
36
|
-
"@atlaskit/editor-common": "^82.
|
|
36
|
+
"@atlaskit/editor-common": "^82.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|