@atlaskit/editor-plugin-annotation 15.0.13 → 15.0.14
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 +10 -0
- package/dist/cjs/editor-commands/transform.js +2 -2
- package/dist/cjs/pm-plugins/inline-comment.js +3 -3
- package/dist/cjs/pm-plugins/toolbar.js +2 -2
- package/dist/cjs/pm-plugins/utils.js +8 -8
- package/dist/cjs/ui/CommentButton/CommentButton.js +2 -2
- package/dist/es2019/editor-commands/transform.js +1 -1
- package/dist/es2019/pm-plugins/inline-comment.js +1 -1
- package/dist/es2019/pm-plugins/toolbar.js +1 -1
- package/dist/es2019/pm-plugins/utils.js +1 -1
- package/dist/es2019/ui/CommentButton/CommentButton.js +1 -1
- package/dist/esm/editor-commands/transform.js +1 -1
- package/dist/esm/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/pm-plugins/toolbar.js +1 -1
- package/dist/esm/pm-plugins/utils.js +1 -1
- package/dist/esm/ui/CommentButton/CommentButton.js +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 15.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`656801b9e097c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/656801b9e097c) -
|
|
8
|
+
VOLTC-331 - Migrate updated package usage in platform/editor: rewrite barrel imports of
|
|
9
|
+
voltCompliant provider packages to deep/subpath imports (consumer-side debarrel). No public API
|
|
10
|
+
changes.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 15.0.13
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ var _mark = require("@atlaskit/editor-common/mark");
|
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
13
|
-
var
|
|
13
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
14
14
|
var _utils2 = require("../pm-plugins/utils");
|
|
15
15
|
var isAnnotationStep = function isAnnotationStep(step) {
|
|
16
16
|
return step instanceof _transform.AddMarkStep && step.mark.type.name === 'annotation';
|
|
@@ -103,7 +103,7 @@ var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
|
103
103
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
104
104
|
attributes: {}
|
|
105
105
|
};
|
|
106
|
-
if ((0,
|
|
106
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
107
107
|
var _ref2 = (0, _utils2.getPluginState)(state) || {},
|
|
108
108
|
bookmark = _ref2.bookmark;
|
|
109
109
|
|
|
@@ -13,7 +13,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
13
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
|
-
var
|
|
16
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
17
|
var _editorCommands = require("../editor-commands");
|
|
18
18
|
var _utils2 = require("../editor-commands/utils");
|
|
19
19
|
var _nodeviews = require("../nodeviews");
|
|
@@ -72,7 +72,7 @@ var fetchState = /*#__PURE__*/function () {
|
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
_ref3 = (0, _utils3.getPluginState)(editorView.state) || {}, annotationsLoaded = _ref3.annotationsLoaded;
|
|
75
|
-
if (!annotationsLoaded && (0,
|
|
75
|
+
if (!annotationsLoaded && (0, _fg.fg)('confluence_frontend_new_dangling_comments_ux')) {
|
|
76
76
|
(0, _editorCommands.setInlineCommentsFetched)()(editorView.state, editorView.dispatch);
|
|
77
77
|
}
|
|
78
78
|
return _context2.abrupt("return");
|
|
@@ -492,7 +492,7 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
492
492
|
key: _utils3.decorationKey.block
|
|
493
493
|
}));
|
|
494
494
|
} else {
|
|
495
|
-
if ((0,
|
|
495
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
496
496
|
if (node.isText) {
|
|
497
497
|
focusDecorations.push(_view.Decoration.inline(pos, pos + node.nodeSize, {
|
|
498
498
|
class: "".concat((0, _nodeviews.getAnnotationViewClassname)(isUnresolved, isSelected, isHovered), " ").concat(isUnresolved),
|
|
@@ -13,7 +13,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
13
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
14
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
15
15
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
16
|
-
var
|
|
16
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
17
|
var _editorCommands = require("../editor-commands");
|
|
18
18
|
var _types = require("../types");
|
|
19
19
|
var _utils2 = require("./utils");
|
|
@@ -82,7 +82,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
|
|
|
82
82
|
return undefined;
|
|
83
83
|
}
|
|
84
84
|
var createCommentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
85
|
-
var commentDisabledMessage = intl.formatMessage((0,
|
|
85
|
+
var commentDisabledMessage = intl.formatMessage((0, _fg.fg)('editor_inline_comments_on_inline_nodes') ? _messages.annotationMessages.createCommentDisabled : _messages.annotationMessages.createCommentInvalid);
|
|
86
86
|
var canAddComments = getCanAddComments();
|
|
87
87
|
var isCommentButtonDisabled = !canAddComments || selectionValid === _types.AnnotationSelectionType.DISABLED;
|
|
88
88
|
var disabledTooltipContent = !canAddComments ? intl.formatMessage(_messages.annotationMessages.noPermissionToAddComment, {
|
|
@@ -23,7 +23,7 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
23
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
24
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
25
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
26
|
-
var
|
|
26
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
27
27
|
var _types = require("../types");
|
|
28
28
|
function sum(arr, f) {
|
|
29
29
|
return arr.reduce(function (val, x) {
|
|
@@ -151,7 +151,7 @@ var findAnnotationsInSelection = exports.findAnnotationsInSelection = function f
|
|
|
151
151
|
anchor = selection.anchor;
|
|
152
152
|
// Only detect annotations on caret selection
|
|
153
153
|
if (!empty || !doc) {
|
|
154
|
-
if ((0,
|
|
154
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
155
155
|
if (selection instanceof _state.NodeSelection && ['inlineCard', 'emoji', 'date', 'mention', 'status'].includes(selection.node.type.name)) {
|
|
156
156
|
// Inline comments on these nodes are supported -- so we continue to find annotations
|
|
157
157
|
} else {
|
|
@@ -280,7 +280,7 @@ var getDraftCommandAnalyticsPayload = exports.getDraftCommandAnalyticsPayload =
|
|
|
280
280
|
overlap: getAnnotationsInSelectionCount(state)
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
if ((0,
|
|
283
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
284
284
|
var _ref2 = getPluginState(state) || {},
|
|
285
285
|
bookmark = _ref2.bookmark;
|
|
286
286
|
attributes.inlineNodeNames = (0, _utils.getRangeInlineNodeNames)({
|
|
@@ -359,25 +359,25 @@ function hasInvalidWhitespaceNode(selection, schema) {
|
|
|
359
359
|
var hasCommentableInlineNodeDescendants = false;
|
|
360
360
|
var hasCommentableTextNodeDescendants = false;
|
|
361
361
|
content.descendants(function (node) {
|
|
362
|
-
if ((0,
|
|
362
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
363
363
|
var isAllowedInlineNode = ['emoji', 'status', 'date', 'mention', 'inlineCard'].includes(node.type.name);
|
|
364
364
|
if (isAllowedInlineNode) {
|
|
365
365
|
hasCommentableInlineNodeDescendants = true;
|
|
366
366
|
return false;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
if (node.type === schema.nodes.inlineCard && (0,
|
|
369
|
+
if (node.type === schema.nodes.inlineCard && (0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
370
370
|
return false;
|
|
371
371
|
}
|
|
372
372
|
if ((0, _utils.isText)(node, schema)) {
|
|
373
|
-
if ((0,
|
|
373
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
374
374
|
if (node.textContent.trim() !== '') {
|
|
375
375
|
hasCommentableTextNodeDescendants = true;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return false;
|
|
379
379
|
}
|
|
380
|
-
if (!(0,
|
|
380
|
+
if (!(0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
381
381
|
if (node.textContent.trim() === '') {
|
|
382
382
|
// Trailing new lines do not result in the annotation spanning into
|
|
383
383
|
// the trailing new line so can be ignored when looking for invalid
|
|
@@ -400,7 +400,7 @@ function hasInvalidWhitespaceNode(selection, schema) {
|
|
|
400
400
|
}
|
|
401
401
|
return !foundInvalidWhitespace;
|
|
402
402
|
});
|
|
403
|
-
if ((0,
|
|
403
|
+
if ((0, _fg.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
404
404
|
if (hasCommentableInlineNodeDescendants) {
|
|
405
405
|
return false;
|
|
406
406
|
}
|
|
@@ -12,7 +12,7 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
17
|
var _utils = require("../../pm-plugins/utils");
|
|
18
18
|
var _types = require("../../types");
|
|
@@ -68,7 +68,7 @@ var CommentButton = exports.CommentButton = function CommentButton(_ref) {
|
|
|
68
68
|
}
|
|
69
69
|
var canAddComments = getCanAddComments ? getCanAddComments() : true;
|
|
70
70
|
var commentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
71
|
-
var commentDisabledMessage = intl.formatMessage((0,
|
|
71
|
+
var commentDisabledMessage = intl.formatMessage((0, _fg.fg)('editor_inline_comments_on_inline_nodes') ? _messages.annotationMessages.createCommentDisabled : _messages.annotationMessages.createCommentInvalid);
|
|
72
72
|
var noPermissionToAddCommentMessage = intl.formatMessage(_messages.annotationMessages.noPermissionToAddComment, {
|
|
73
73
|
contentType: contentType
|
|
74
74
|
});
|
|
@@ -4,7 +4,7 @@ import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
|
4
4
|
import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
8
|
import { getDraftCommandAnalyticsPayload, getPluginState, resolveDraftBookmark } from '../pm-plugins/utils';
|
|
9
9
|
const isAnnotationStep = step => step instanceof AddMarkStep && step.mark.type.name === 'annotation';
|
|
10
10
|
const addAnnotationMark = (id, supportedBlockNodes) => (transaction, state) => {
|
|
@@ -3,7 +3,7 @@ import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { getAnnotationInlineNodeTypes } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { clearDirtyMark, closeComponent, setHoveredAnnotation, setInlineCommentsVisibility, setSelectedAnnotation, flushPendingSelections, updateInlineCommentResolvedState, updateMouseState, setPendingSelectedAnnotation, setInlineCommentDraftState, setInlineCommentsFetched } from '../editor-commands';
|
|
8
8
|
import { resetUserIntent, setUserIntent } from '../editor-commands/utils';
|
|
9
9
|
import { getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
@@ -6,7 +6,7 @@ import { annotationMessages } from '@atlaskit/editor-common/messages';
|
|
|
6
6
|
import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
8
8
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { setInlineCommentDraftState } from '../editor-commands';
|
|
11
11
|
import { AnnotationSelectionType, AnnotationTestIds } from '../types';
|
|
12
12
|
import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
|
|
@@ -5,7 +5,7 @@ import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@at
|
|
|
5
5
|
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, 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
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
9
|
import { AnnotationSelectionType } from '../types';
|
|
10
10
|
function sum(arr, f) {
|
|
11
11
|
return arr.reduce((val, x) => val + f(x), 0);
|
|
@@ -5,7 +5,7 @@ import { ToolTipContent, addInlineComment } from '@atlaskit/editor-common/keymap
|
|
|
5
5
|
import { annotationMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ToolbarButton, CommentIcon as NewCommentIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
10
|
import { isSelectionValid } from '../../pm-plugins/utils';
|
|
11
11
|
import { AnnotationSelectionType, AnnotationTestIds } from '../../types';
|
|
@@ -4,7 +4,7 @@ import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
|
4
4
|
import { getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
8
|
import { getDraftCommandAnalyticsPayload, getPluginState, resolveDraftBookmark } from '../pm-plugins/utils';
|
|
9
9
|
var isAnnotationStep = function isAnnotationStep(step) {
|
|
10
10
|
return step instanceof AddMarkStep && step.mark.type.name === 'annotation';
|
|
@@ -6,7 +6,7 @@ import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
7
|
import { getAnnotationInlineNodeTypes } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { clearDirtyMark, closeComponent, setHoveredAnnotation, setInlineCommentsVisibility, setSelectedAnnotation, flushPendingSelections, updateInlineCommentResolvedState, updateMouseState, setPendingSelectedAnnotation, setInlineCommentDraftState, setInlineCommentsFetched } from '../editor-commands';
|
|
11
11
|
import { resetUserIntent, setUserIntent } from '../editor-commands/utils';
|
|
12
12
|
import { getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
@@ -6,7 +6,7 @@ import { annotationMessages } from '@atlaskit/editor-common/messages';
|
|
|
6
6
|
import { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
8
8
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { setInlineCommentDraftState } from '../editor-commands';
|
|
11
11
|
import { AnnotationSelectionType, AnnotationTestIds } from '../types';
|
|
12
12
|
import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
|
|
@@ -6,7 +6,7 @@ import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@at
|
|
|
6
6
|
import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, isParagraph, isText } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
10
|
import { AnnotationSelectionType } from '../types';
|
|
11
11
|
function sum(arr, f) {
|
|
12
12
|
return arr.reduce(function (val, x) {
|
|
@@ -5,7 +5,7 @@ import { ToolTipContent, addInlineComment } from '@atlaskit/editor-common/keymap
|
|
|
5
5
|
import { annotationMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { ToolbarButton, CommentIcon as NewCommentIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
10
|
import { isSelectionValid } from '../../pm-plugins/utils';
|
|
11
11
|
import { AnnotationSelectionType, AnnotationTestIds } from '../../types';
|
|
@@ -98,7 +98,6 @@ export type InlineCommentAction = {
|
|
|
98
98
|
type: ACTIONS.SET_INLINE_COMMENTS_FETCHED;
|
|
99
99
|
};
|
|
100
100
|
export type InlineCommentPluginState = {
|
|
101
|
-
annotationsLoaded: boolean;
|
|
102
101
|
/**
|
|
103
102
|
* The resolved state of the annotations.
|
|
104
103
|
*
|
|
@@ -120,6 +119,7 @@ export type InlineCommentPluginState = {
|
|
|
120
119
|
* ```
|
|
121
120
|
*/
|
|
122
121
|
annotations: InlineCommentMap;
|
|
122
|
+
annotationsLoaded: boolean;
|
|
123
123
|
bookmark?: SelectionBookmark;
|
|
124
124
|
/**
|
|
125
125
|
* Indicates the document has annotations which it does not currently know the resolved state of.
|