@atlaskit/editor-plugin-annotation 1.7.4 → 1.9.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 +25 -0
- package/dist/cjs/commands/index.js +3 -2
- package/dist/cjs/pm-plugins/plugin-factory.js +7 -3
- package/dist/cjs/pm-plugins/reducer.js +3 -1
- package/dist/cjs/ui/InlineCommentView.js +13 -2
- package/dist/es2019/commands/index.js +3 -2
- package/dist/es2019/pm-plugins/plugin-factory.js +5 -2
- package/dist/es2019/pm-plugins/reducer.js +3 -1
- package/dist/es2019/ui/InlineCommentView.js +12 -1
- package/dist/esm/commands/index.js +3 -2
- package/dist/esm/pm-plugins/plugin-factory.js +7 -3
- package/dist/esm/pm-plugins/reducer.js +3 -1
- package/dist/esm/ui/InlineCommentView.js +13 -2
- package/dist/types/commands/index.d.ts +2 -2
- package/dist/types/commands/transform.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +3 -1
- package/dist/types-ts4.5/commands/index.d.ts +2 -2
- package/dist/types-ts4.5/commands/transform.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#100662](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100662)
|
|
8
|
+
[`3d61cd8f2afe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3d61cd8f2afe) -
|
|
9
|
+
[ED-23355] Update annotation viewed event to with attributes nodeType and method to capture
|
|
10
|
+
usage for comments on media
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 1.8.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [#99579](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99579)
|
|
21
|
+
[`f222af5687e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f222af5687e9) -
|
|
22
|
+
Bump adf-schema to 36.3.0 and adf-schema-json to 1.14.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 1.7.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -138,7 +138,7 @@ var getDraftCommandAction = function getDraftCommandAction(drafting, targetType,
|
|
|
138
138
|
*/
|
|
139
139
|
var showInlineCommentForBlockNode = exports.showInlineCommentForBlockNode = function showInlineCommentForBlockNode() {
|
|
140
140
|
var supportedBlockNodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
141
|
-
return function (node) {
|
|
141
|
+
return function (node, viewMethod) {
|
|
142
142
|
return function (state, dispatch) {
|
|
143
143
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
144
144
|
var annotation = state.schema.marks.annotation;
|
|
@@ -159,7 +159,8 @@ var showInlineCommentForBlockNode = exports.showInlineCommentForBlockNode = func
|
|
|
159
159
|
dispatch(state.tr.setMeta(_utils.inlineCommentPluginKey, {
|
|
160
160
|
type: _types.ACTIONS.SET_SELECTED_ANNOTATION,
|
|
161
161
|
data: {
|
|
162
|
-
selectedAnnotations: unresolvedAnnotationMarks
|
|
162
|
+
selectedAnnotations: unresolvedAnnotationMarks,
|
|
163
|
+
selectAnnotationMethod: viewMethod
|
|
163
164
|
}
|
|
164
165
|
}));
|
|
165
166
|
return true;
|
|
@@ -42,18 +42,22 @@ var getSelectionChangedHandler = function getSelectionChangedHandler(reopenComme
|
|
|
42
42
|
if (selectedAnnotations.length === 0) {
|
|
43
43
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
44
44
|
selectedAnnotations: selectedAnnotations,
|
|
45
|
-
isInlineCommentViewClosed: true
|
|
45
|
+
isInlineCommentViewClosed: true,
|
|
46
|
+
selectAnnotationMethod: undefined
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
if ((0, _utils2.isSelectedAnnotationsChanged)(selectedAnnotations, pluginState.selectedAnnotations)) {
|
|
49
50
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
50
|
-
selectedAnnotations: selectedAnnotations
|
|
51
|
+
selectedAnnotations: selectedAnnotations,
|
|
52
|
+
selectAnnotationMethod: undefined
|
|
51
53
|
}, reopenCommentView && {
|
|
52
54
|
isInlineCommentViewClosed: false
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
return _objectSpread(_objectSpread({}, pluginState), reopenCommentView && {
|
|
57
|
+
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), reopenCommentView && {
|
|
56
58
|
isInlineCommentViewClosed: false
|
|
59
|
+
}), {}, {
|
|
60
|
+
selectAnnotationMethod: undefined
|
|
57
61
|
});
|
|
58
62
|
};
|
|
59
63
|
};
|
|
@@ -40,7 +40,8 @@ var _default = exports.default = function _default(pluginState, action) {
|
|
|
40
40
|
return _objectSpread(_objectSpread({}, updatedPluginState), {}, {
|
|
41
41
|
selectedAnnotations: [].concat((0, _toConsumableArray2.default)(updatedPluginState.selectedAnnotations), (0, _toConsumableArray2.default)(action.data.selectedAnnotations)),
|
|
42
42
|
annotations: _objectSpread(_objectSpread({}, pluginState.annotations), action.data.inlineComments),
|
|
43
|
-
isInlineCommentViewClosed: false
|
|
43
|
+
isInlineCommentViewClosed: false,
|
|
44
|
+
selectAnnotationMethod: undefined
|
|
44
45
|
});
|
|
45
46
|
case _types.ACTIONS.INLINE_COMMENT_SET_VISIBLE:
|
|
46
47
|
var isVisible = action.data.isVisible;
|
|
@@ -53,6 +54,7 @@ var _default = exports.default = function _default(pluginState, action) {
|
|
|
53
54
|
case _types.ACTIONS.SET_SELECTED_ANNOTATION:
|
|
54
55
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
55
56
|
selectedAnnotations: (0, _toConsumableArray2.default)(action.data.selectedAnnotations),
|
|
57
|
+
selectAnnotationMethod: action.data.selectAnnotationMethod,
|
|
56
58
|
skipSelectionHandling: true,
|
|
57
59
|
isInlineCommentViewClosed: false
|
|
58
60
|
});
|
|
@@ -14,6 +14,8 @@ var _commands = require("../commands");
|
|
|
14
14
|
var _types = require("../types");
|
|
15
15
|
var _utils2 = require("../utils");
|
|
16
16
|
var _AnnotationViewWrapper = require("./AnnotationViewWrapper");
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
17
19
|
var findPosForDOM = function findPosForDOM(sel) {
|
|
18
20
|
var $from = sel.$from,
|
|
19
21
|
from = sel.from;
|
|
@@ -110,18 +112,27 @@ function InlineCommentView(_ref) {
|
|
|
110
112
|
return null;
|
|
111
113
|
}
|
|
112
114
|
var onAnnotationViewed = function onAnnotationViewed() {
|
|
115
|
+
var _editorView$state$doc;
|
|
113
116
|
if (!dispatchAnalyticsEvent) {
|
|
114
117
|
return;
|
|
115
118
|
}
|
|
119
|
+
var _ref3 = inlineCommentState || {},
|
|
120
|
+
selectAnnotationMethod = _ref3.selectAnnotationMethod,
|
|
121
|
+
featureFlagsPluginState = _ref3.featureFlagsPluginState;
|
|
122
|
+
var isCommentsOnMediaAnalyticsEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaAnalytics;
|
|
123
|
+
|
|
116
124
|
// fire analytics
|
|
117
125
|
var payload = {
|
|
118
126
|
action: _analytics.ACTION.VIEWED,
|
|
119
127
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
120
128
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
121
129
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
122
|
-
attributes: {
|
|
130
|
+
attributes: _objectSpread({
|
|
123
131
|
overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0
|
|
124
|
-
}
|
|
132
|
+
}, isCommentsOnMediaAnalyticsEnabled && {
|
|
133
|
+
targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
|
|
134
|
+
method: selectAnnotationMethod
|
|
135
|
+
})
|
|
125
136
|
};
|
|
126
137
|
dispatchAnalyticsEvent(payload);
|
|
127
138
|
};
|
|
@@ -118,7 +118,7 @@ const getDraftCommandAction = (drafting, targetType, targetNodeId, isCommentOnMe
|
|
|
118
118
|
* Show active inline comments for a given block node, otherwise,
|
|
119
119
|
* return false if the node has no comments or no unresolved comments.
|
|
120
120
|
*/
|
|
121
|
-
export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => node => (state, dispatch) => {
|
|
121
|
+
export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => (node, viewMethod) => (state, dispatch) => {
|
|
122
122
|
const pluginState = getPluginState(state);
|
|
123
123
|
const {
|
|
124
124
|
annotation
|
|
@@ -136,7 +136,8 @@ export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => node
|
|
|
136
136
|
dispatch(state.tr.setMeta(inlineCommentPluginKey, {
|
|
137
137
|
type: ACTIONS.SET_SELECTED_ANNOTATION,
|
|
138
138
|
data: {
|
|
139
|
-
selectedAnnotations: unresolvedAnnotationMarks
|
|
139
|
+
selectedAnnotations: unresolvedAnnotationMarks,
|
|
140
|
+
selectAnnotationMethod: viewMethod
|
|
140
141
|
}
|
|
141
142
|
}));
|
|
142
143
|
return true;
|
|
@@ -38,13 +38,15 @@ const getSelectionChangedHandler = reopenCommentView => (tr, pluginState) => {
|
|
|
38
38
|
return {
|
|
39
39
|
...pluginState,
|
|
40
40
|
selectedAnnotations,
|
|
41
|
-
isInlineCommentViewClosed: true
|
|
41
|
+
isInlineCommentViewClosed: true,
|
|
42
|
+
selectAnnotationMethod: undefined
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
if (isSelectedAnnotationsChanged(selectedAnnotations, pluginState.selectedAnnotations)) {
|
|
45
46
|
return {
|
|
46
47
|
...pluginState,
|
|
47
48
|
selectedAnnotations,
|
|
49
|
+
selectAnnotationMethod: undefined,
|
|
48
50
|
...(reopenCommentView && {
|
|
49
51
|
isInlineCommentViewClosed: false
|
|
50
52
|
})
|
|
@@ -54,7 +56,8 @@ const getSelectionChangedHandler = reopenCommentView => (tr, pluginState) => {
|
|
|
54
56
|
...pluginState,
|
|
55
57
|
...(reopenCommentView && {
|
|
56
58
|
isInlineCommentViewClosed: false
|
|
57
|
-
})
|
|
59
|
+
}),
|
|
60
|
+
selectAnnotationMethod: undefined
|
|
58
61
|
};
|
|
59
62
|
};
|
|
60
63
|
export const {
|
|
@@ -40,7 +40,8 @@ export default ((pluginState, action) => {
|
|
|
40
40
|
...pluginState.annotations,
|
|
41
41
|
...action.data.inlineComments
|
|
42
42
|
},
|
|
43
|
-
isInlineCommentViewClosed: false
|
|
43
|
+
isInlineCommentViewClosed: false,
|
|
44
|
+
selectAnnotationMethod: undefined
|
|
44
45
|
};
|
|
45
46
|
case ACTIONS.INLINE_COMMENT_SET_VISIBLE:
|
|
46
47
|
const {
|
|
@@ -57,6 +58,7 @@ export default ((pluginState, action) => {
|
|
|
57
58
|
return {
|
|
58
59
|
...pluginState,
|
|
59
60
|
selectedAnnotations: [...action.data.selectedAnnotations],
|
|
61
|
+
selectAnnotationMethod: action.data.selectAnnotationMethod,
|
|
60
62
|
skipSelectionHandling: true,
|
|
61
63
|
isInlineCommentViewClosed: false
|
|
62
64
|
};
|
|
@@ -108,9 +108,16 @@ export function InlineCommentView({
|
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
110
|
const onAnnotationViewed = () => {
|
|
111
|
+
var _editorView$state$doc;
|
|
111
112
|
if (!dispatchAnalyticsEvent) {
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
115
|
+
const {
|
|
116
|
+
selectAnnotationMethod,
|
|
117
|
+
featureFlagsPluginState
|
|
118
|
+
} = inlineCommentState || {};
|
|
119
|
+
const isCommentsOnMediaAnalyticsEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaAnalytics;
|
|
120
|
+
|
|
114
121
|
// fire analytics
|
|
115
122
|
const payload = {
|
|
116
123
|
action: ACTION.VIEWED,
|
|
@@ -118,7 +125,11 @@ export function InlineCommentView({
|
|
|
118
125
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
119
126
|
eventType: EVENT_TYPE.TRACK,
|
|
120
127
|
attributes: {
|
|
121
|
-
overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0
|
|
128
|
+
overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0,
|
|
129
|
+
...(isCommentsOnMediaAnalyticsEnabled && {
|
|
130
|
+
targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
|
|
131
|
+
method: selectAnnotationMethod
|
|
132
|
+
})
|
|
122
133
|
}
|
|
123
134
|
};
|
|
124
135
|
dispatchAnalyticsEvent(payload);
|
|
@@ -131,7 +131,7 @@ var getDraftCommandAction = function getDraftCommandAction(drafting, targetType,
|
|
|
131
131
|
*/
|
|
132
132
|
export var showInlineCommentForBlockNode = function showInlineCommentForBlockNode() {
|
|
133
133
|
var supportedBlockNodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
134
|
-
return function (node) {
|
|
134
|
+
return function (node, viewMethod) {
|
|
135
135
|
return function (state, dispatch) {
|
|
136
136
|
var pluginState = getPluginState(state);
|
|
137
137
|
var annotation = state.schema.marks.annotation;
|
|
@@ -152,7 +152,8 @@ export var showInlineCommentForBlockNode = function showInlineCommentForBlockNod
|
|
|
152
152
|
dispatch(state.tr.setMeta(inlineCommentPluginKey, {
|
|
153
153
|
type: ACTIONS.SET_SELECTED_ANNOTATION,
|
|
154
154
|
data: {
|
|
155
|
-
selectedAnnotations: unresolvedAnnotationMarks
|
|
155
|
+
selectedAnnotations: unresolvedAnnotationMarks,
|
|
156
|
+
selectAnnotationMethod: viewMethod
|
|
156
157
|
}
|
|
157
158
|
}));
|
|
158
159
|
return true;
|
|
@@ -35,18 +35,22 @@ var getSelectionChangedHandler = function getSelectionChangedHandler(reopenComme
|
|
|
35
35
|
if (selectedAnnotations.length === 0) {
|
|
36
36
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
37
37
|
selectedAnnotations: selectedAnnotations,
|
|
38
|
-
isInlineCommentViewClosed: true
|
|
38
|
+
isInlineCommentViewClosed: true,
|
|
39
|
+
selectAnnotationMethod: undefined
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
if (isSelectedAnnotationsChanged(selectedAnnotations, pluginState.selectedAnnotations)) {
|
|
42
43
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
43
|
-
selectedAnnotations: selectedAnnotations
|
|
44
|
+
selectedAnnotations: selectedAnnotations,
|
|
45
|
+
selectAnnotationMethod: undefined
|
|
44
46
|
}, reopenCommentView && {
|
|
45
47
|
isInlineCommentViewClosed: false
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
return _objectSpread(_objectSpread({}, pluginState), reopenCommentView && {
|
|
50
|
+
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), reopenCommentView && {
|
|
49
51
|
isInlineCommentViewClosed: false
|
|
52
|
+
}), {}, {
|
|
53
|
+
selectAnnotationMethod: undefined
|
|
50
54
|
});
|
|
51
55
|
};
|
|
52
56
|
};
|
|
@@ -33,7 +33,8 @@ export default (function (pluginState, action) {
|
|
|
33
33
|
return _objectSpread(_objectSpread({}, updatedPluginState), {}, {
|
|
34
34
|
selectedAnnotations: [].concat(_toConsumableArray(updatedPluginState.selectedAnnotations), _toConsumableArray(action.data.selectedAnnotations)),
|
|
35
35
|
annotations: _objectSpread(_objectSpread({}, pluginState.annotations), action.data.inlineComments),
|
|
36
|
-
isInlineCommentViewClosed: false
|
|
36
|
+
isInlineCommentViewClosed: false,
|
|
37
|
+
selectAnnotationMethod: undefined
|
|
37
38
|
});
|
|
38
39
|
case ACTIONS.INLINE_COMMENT_SET_VISIBLE:
|
|
39
40
|
var isVisible = action.data.isVisible;
|
|
@@ -46,6 +47,7 @@ export default (function (pluginState, action) {
|
|
|
46
47
|
case ACTIONS.SET_SELECTED_ANNOTATION:
|
|
47
48
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
48
49
|
selectedAnnotations: _toConsumableArray(action.data.selectedAnnotations),
|
|
50
|
+
selectAnnotationMethod: action.data.selectAnnotationMethod,
|
|
49
51
|
skipSelectionHandling: true,
|
|
50
52
|
isInlineCommentViewClosed: false
|
|
51
53
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
4
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, EVENT_TYPE, RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -103,18 +105,27 @@ export function InlineCommentView(_ref) {
|
|
|
103
105
|
return null;
|
|
104
106
|
}
|
|
105
107
|
var onAnnotationViewed = function onAnnotationViewed() {
|
|
108
|
+
var _editorView$state$doc;
|
|
106
109
|
if (!dispatchAnalyticsEvent) {
|
|
107
110
|
return;
|
|
108
111
|
}
|
|
112
|
+
var _ref3 = inlineCommentState || {},
|
|
113
|
+
selectAnnotationMethod = _ref3.selectAnnotationMethod,
|
|
114
|
+
featureFlagsPluginState = _ref3.featureFlagsPluginState;
|
|
115
|
+
var isCommentsOnMediaAnalyticsEnabled = featureFlagsPluginState === null || featureFlagsPluginState === void 0 ? void 0 : featureFlagsPluginState.commentsOnMediaAnalytics;
|
|
116
|
+
|
|
109
117
|
// fire analytics
|
|
110
118
|
var payload = {
|
|
111
119
|
action: ACTION.VIEWED,
|
|
112
120
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
113
121
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
114
122
|
eventType: EVENT_TYPE.TRACK,
|
|
115
|
-
attributes: {
|
|
123
|
+
attributes: _objectSpread({
|
|
116
124
|
overlap: activeAnnotations.length ? activeAnnotations.length - 1 : 0
|
|
117
|
-
}
|
|
125
|
+
}, isCommentsOnMediaAnalyticsEnabled && {
|
|
126
|
+
targetNodeType: (_editorView$state$doc = editorView.state.doc.nodeAt(position)) === null || _editorView$state$doc === void 0 ? void 0 : _editorView$state$doc.type.name,
|
|
127
|
+
method: selectAnnotationMethod
|
|
128
|
+
})
|
|
118
129
|
};
|
|
119
130
|
dispatchAnalyticsEvent(payload);
|
|
120
131
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { RESOLVE_METHOD, type VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { InlineCommentMap, InlineCommentMouseData } from '../pm-plugins/types';
|
|
@@ -13,7 +13,7 @@ export declare const removeInlineCommentNearSelection: (id: string, supportedNod
|
|
|
13
13
|
* Show active inline comments for a given block node, otherwise,
|
|
14
14
|
* return false if the node has no comments or no unresolved comments.
|
|
15
15
|
*/
|
|
16
|
-
export declare const showInlineCommentForBlockNode: (supportedBlockNodes?: string[]) => (node: PMNode | null) => Command;
|
|
16
|
+
export declare const showInlineCommentForBlockNode: (supportedBlockNodes?: string[]) => (node: PMNode | null, viewMethod?: VIEW_METHOD) => Command;
|
|
17
17
|
export declare const setInlineCommentDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, supportedBlockNodes?: string[]) => (drafting: boolean, inputMethod?: InlineCommentInputMethod, targetType?: TargetType, isCommentOnMediaOn?: boolean, targetNodeId?: string | undefined) => Command;
|
|
18
18
|
export declare const addInlineComment: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorAPI?: ExtractInjectionAPI<AnnotationPlugin> | undefined) => (id: string, supportedBlockNodes?: string[]) => Command;
|
|
19
19
|
export declare const updateMouseState: (mouseData: InlineCommentMouseData) => Command;
|
|
@@ -69,7 +69,7 @@ declare const _default: {
|
|
|
69
69
|
actions: {
|
|
70
70
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: EditorState) => boolean | undefined;
|
|
71
71
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: InlineCommentInputMethod, targetType?: import("../types").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
72
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
72
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
73
73
|
};
|
|
74
74
|
}, import("../types").AnnotationProviders | undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
75
75
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { EditorAnalyticsAPI, VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
@@ -69,6 +69,7 @@ export type InlineCommentAction = {
|
|
|
69
69
|
type: ACTIONS.SET_SELECTED_ANNOTATION;
|
|
70
70
|
data: {
|
|
71
71
|
selectedAnnotations: AnnotationInfo[];
|
|
72
|
+
selectAnnotationMethod?: VIEW_METHOD;
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
export type InlineCommentPluginState = {
|
|
@@ -85,4 +86,5 @@ export type InlineCommentPluginState = {
|
|
|
85
86
|
featureFlagsPluginState?: FeatureFlags;
|
|
86
87
|
isDrafting: boolean;
|
|
87
88
|
targetNodeId?: string;
|
|
89
|
+
selectAnnotationMethod?: VIEW_METHOD;
|
|
88
90
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { RESOLVE_METHOD, type VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { InlineCommentMap, InlineCommentMouseData } from '../pm-plugins/types';
|
|
@@ -13,7 +13,7 @@ export declare const removeInlineCommentNearSelection: (id: string, supportedNod
|
|
|
13
13
|
* Show active inline comments for a given block node, otherwise,
|
|
14
14
|
* return false if the node has no comments or no unresolved comments.
|
|
15
15
|
*/
|
|
16
|
-
export declare const showInlineCommentForBlockNode: (supportedBlockNodes?: string[]) => (node: PMNode | null) => Command;
|
|
16
|
+
export declare const showInlineCommentForBlockNode: (supportedBlockNodes?: string[]) => (node: PMNode | null, viewMethod?: VIEW_METHOD) => Command;
|
|
17
17
|
export declare const setInlineCommentDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, supportedBlockNodes?: string[]) => (drafting: boolean, inputMethod?: InlineCommentInputMethod, targetType?: TargetType, isCommentOnMediaOn?: boolean, targetNodeId?: string | undefined) => Command;
|
|
18
18
|
export declare const addInlineComment: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorAPI?: ExtractInjectionAPI<AnnotationPlugin> | undefined) => (id: string, supportedBlockNodes?: string[]) => Command;
|
|
19
19
|
export declare const updateMouseState: (mouseData: InlineCommentMouseData) => Command;
|
|
@@ -83,7 +83,7 @@ declare const _default: {
|
|
|
83
83
|
actions: {
|
|
84
84
|
stripNonExistingAnnotations: (slice: import("prosemirror-model").Slice, state: EditorState) => boolean | undefined;
|
|
85
85
|
setInlineCommentDraftState: (drafting: boolean, inputMethod: InlineCommentInputMethod, targetType?: import("../types").TargetType | undefined, isCommentOnMediaOn?: boolean | undefined, targetNodeId?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
86
|
-
showCommentForBlockNode: (node: import("prosemirror-model").Node | null) => import("@atlaskit/editor-common/types").Command;
|
|
86
|
+
showCommentForBlockNode: (node: import("prosemirror-model").Node | null, viewMethod?: import("@atlaskit/editor-common/analytics").VIEW_METHOD | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
87
87
|
};
|
|
88
88
|
}, import("../types").AnnotationProviders | undefined>,
|
|
89
89
|
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { EditorAnalyticsAPI, VIEW_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
@@ -69,6 +69,7 @@ export type InlineCommentAction = {
|
|
|
69
69
|
type: ACTIONS.SET_SELECTED_ANNOTATION;
|
|
70
70
|
data: {
|
|
71
71
|
selectedAnnotations: AnnotationInfo[];
|
|
72
|
+
selectAnnotationMethod?: VIEW_METHOD;
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
export type InlineCommentPluginState = {
|
|
@@ -85,4 +86,5 @@ export type InlineCommentPluginState = {
|
|
|
85
86
|
featureFlagsPluginState?: FeatureFlags;
|
|
86
87
|
isDrafting: boolean;
|
|
87
88
|
targetNodeId?: string;
|
|
89
|
+
selectAnnotationMethod?: VIEW_METHOD;
|
|
88
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^36.
|
|
36
|
-
"@atlaskit/editor-common": "^80.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
35
|
+
"@atlaskit/adf-schema": "^36.3.0",
|
|
36
|
+
"@atlaskit/editor-common": "^80.4.0",
|
|
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",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
|
-
"@atlaskit/icon": "^22.
|
|
41
|
+
"@atlaskit/icon": "^22.2.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0"
|
|
44
44
|
},
|