@atlaskit/editor-plugin-annotation 1.26.14 → 1.27.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 +20 -0
- package/dist/cjs/annotationPlugin.js +1 -1
- package/dist/cjs/editor-commands/index.js +3 -12
- package/dist/cjs/pm-plugins/reducer.js +1 -2
- package/dist/es2019/annotationPlugin.js +1 -1
- package/dist/es2019/editor-commands/index.js +3 -12
- package/dist/es2019/pm-plugins/reducer.js +0 -3
- package/dist/esm/annotationPlugin.js +1 -1
- package/dist/esm/editor-commands/index.js +3 -12
- package/dist/esm/pm-plugins/reducer.js +0 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 1.27.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
|
|
8
|
+
[`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
|
|
9
|
+
Update `React` from v16 to v18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.26.15
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#107473](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107473)
|
|
20
|
+
[`962b3297548df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/962b3297548df) -
|
|
21
|
+
[ux] Implement variation 2 for editor contextual toolbar formatting experiment
|
|
22
|
+
|
|
3
23
|
## 1.26.14
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -97,7 +97,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
97
97
|
return undefined;
|
|
98
98
|
} else {
|
|
99
99
|
return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
|
|
100
|
-
rank: (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
100
|
+
rank: (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -54,10 +54,7 @@ var clearDirtyMark = exports.clearDirtyMark = function clearDirtyMark() {
|
|
|
54
54
|
var removeInlineCommentFromNode = function removeInlineCommentFromNode(id) {
|
|
55
55
|
var supportedBlockNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
56
56
|
var state = arguments.length > 2 ? arguments[2] : undefined;
|
|
57
|
-
var dispatch
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
57
|
+
var dispatch = arguments.length > 3 ? arguments[3] : undefined;
|
|
61
58
|
var tr = state.tr,
|
|
62
59
|
selection = state.selection;
|
|
63
60
|
if (selection instanceof _state.NodeSelection && (0, _utils.isSupportedBlockNode)(selection.node, supportedBlockNodes)) {
|
|
@@ -115,10 +112,7 @@ var removeInlineCommentNearSelection = exports.removeInlineCommentNearSelection
|
|
|
115
112
|
return true;
|
|
116
113
|
};
|
|
117
114
|
};
|
|
118
|
-
var getDraftCommandAction = function getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar
|
|
119
|
-
// Ignored via go/ees005
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
121
|
-
) {
|
|
115
|
+
var getDraftCommandAction = function getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar) {
|
|
122
116
|
return function (editorState) {
|
|
123
117
|
// validate selection only when entering draft mode
|
|
124
118
|
if (drafting && (0, _utils.isSelectionValid)(editorState) !== _types2.AnnotationSelectionType.VALID) {
|
|
@@ -184,10 +178,7 @@ var setInlineCommentDraftState = exports.setInlineCommentDraftState = function s
|
|
|
184
178
|
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
185
179
|
var targetType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'inline';
|
|
186
180
|
var targetNodeId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
187
|
-
var isOpeningMediaCommentFromToolbar
|
|
188
|
-
// Ignored via go/ees005
|
|
189
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
190
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
181
|
+
var isOpeningMediaCommentFromToolbar = arguments.length > 4 ? arguments[4] : undefined;
|
|
191
182
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
192
183
|
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
193
184
|
};
|
|
@@ -69,8 +69,7 @@ var _default = exports.default = function _default(pluginState, action) {
|
|
|
69
69
|
default:
|
|
70
70
|
return pluginState;
|
|
71
71
|
}
|
|
72
|
-
};
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
72
|
+
};
|
|
74
73
|
function getNewDraftState(pluginState, drafting, editorState, targetType, supportedBlockNodes, targetNodeId, isOpeningMediaCommentFromToolbar) {
|
|
75
74
|
var draftDecorationSet = pluginState.draftDecorationSet;
|
|
76
75
|
if (!draftDecorationSet || !drafting) {
|
|
@@ -90,7 +90,7 @@ export const annotationPlugin = ({
|
|
|
90
90
|
} else {
|
|
91
91
|
return {
|
|
92
92
|
...toolbarConfig,
|
|
93
|
-
rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
93
|
+
rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -31,10 +31,7 @@ export const closeComponent = () => createCommand({
|
|
|
31
31
|
export const clearDirtyMark = () => createCommand({
|
|
32
32
|
type: ACTIONS.INLINE_COMMENT_CLEAR_DIRTY_MARK
|
|
33
33
|
});
|
|
34
|
-
const removeInlineCommentFromNode = (id, supportedBlockNodes = [], state, dispatch
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
|
-
) => {
|
|
34
|
+
const removeInlineCommentFromNode = (id, supportedBlockNodes = [], state, dispatch) => {
|
|
38
35
|
const {
|
|
39
36
|
tr,
|
|
40
37
|
selection
|
|
@@ -97,10 +94,7 @@ export const removeInlineCommentNearSelection = (id, supportedNodes = []) => (st
|
|
|
97
94
|
}
|
|
98
95
|
return true;
|
|
99
96
|
};
|
|
100
|
-
const getDraftCommandAction = (drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar
|
|
101
|
-
// Ignored via go/ees005
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
103
|
-
) => {
|
|
97
|
+
const getDraftCommandAction = (drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar) => {
|
|
104
98
|
return editorState => {
|
|
105
99
|
// validate selection only when entering draft mode
|
|
106
100
|
if (drafting && isSelectionValid(editorState) !== AnnotationSelectionType.VALID) {
|
|
@@ -153,10 +147,7 @@ export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => (node
|
|
|
153
147
|
}
|
|
154
148
|
return false;
|
|
155
149
|
};
|
|
156
|
-
export const setInlineCommentDraftState = (editorAnalyticsAPI, supportedBlockNodes = []) => (drafting, inputMethod = INPUT_METHOD.TOOLBAR, targetType = 'inline', targetNodeId = undefined, isOpeningMediaCommentFromToolbar
|
|
157
|
-
// Ignored via go/ees005
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
159
|
-
) => {
|
|
150
|
+
export const setInlineCommentDraftState = (editorAnalyticsAPI, supportedBlockNodes = []) => (drafting, inputMethod = INPUT_METHOD.TOOLBAR, targetType = 'inline', targetNodeId = undefined, isOpeningMediaCommentFromToolbar) => {
|
|
160
151
|
const commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
161
152
|
return createCommand(commandAction, transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
162
153
|
};
|
|
@@ -75,9 +75,6 @@ export default ((pluginState, action) => {
|
|
|
75
75
|
return pluginState;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
|
|
79
|
-
// Ignored via go/ees005
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
81
78
|
function getNewDraftState(pluginState, drafting, editorState, targetType, supportedBlockNodes, targetNodeId, isOpeningMediaCommentFromToolbar) {
|
|
82
79
|
let {
|
|
83
80
|
draftDecorationSet
|
|
@@ -90,7 +90,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
90
90
|
return undefined;
|
|
91
91
|
} else {
|
|
92
92
|
return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
|
|
93
|
-
rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
93
|
+
rank: editorExperiment('contextual_formatting_toolbar', true) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1') || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant2') ? 1 : undefined
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -47,10 +47,7 @@ export var clearDirtyMark = function clearDirtyMark() {
|
|
|
47
47
|
var removeInlineCommentFromNode = function removeInlineCommentFromNode(id) {
|
|
48
48
|
var supportedBlockNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
49
49
|
var state = arguments.length > 2 ? arguments[2] : undefined;
|
|
50
|
-
var dispatch
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
53
|
-
= arguments.length > 3 ? arguments[3] : undefined;
|
|
50
|
+
var dispatch = arguments.length > 3 ? arguments[3] : undefined;
|
|
54
51
|
var tr = state.tr,
|
|
55
52
|
selection = state.selection;
|
|
56
53
|
if (selection instanceof NodeSelection && isSupportedBlockNode(selection.node, supportedBlockNodes)) {
|
|
@@ -108,10 +105,7 @@ export var removeInlineCommentNearSelection = function removeInlineCommentNearSe
|
|
|
108
105
|
return true;
|
|
109
106
|
};
|
|
110
107
|
};
|
|
111
|
-
var getDraftCommandAction = function getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar
|
|
112
|
-
// Ignored via go/ees005
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
114
|
-
) {
|
|
108
|
+
var getDraftCommandAction = function getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar) {
|
|
115
109
|
return function (editorState) {
|
|
116
110
|
// validate selection only when entering draft mode
|
|
117
111
|
if (drafting && isSelectionValid(editorState) !== AnnotationSelectionType.VALID) {
|
|
@@ -177,10 +171,7 @@ export var setInlineCommentDraftState = function setInlineCommentDraftState(edit
|
|
|
177
171
|
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INPUT_METHOD.TOOLBAR;
|
|
178
172
|
var targetType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'inline';
|
|
179
173
|
var targetNodeId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
180
|
-
var isOpeningMediaCommentFromToolbar
|
|
181
|
-
// Ignored via go/ees005
|
|
182
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
183
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
174
|
+
var isOpeningMediaCommentFromToolbar = arguments.length > 4 ? arguments[4] : undefined;
|
|
184
175
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
185
176
|
return createCommand(commandAction, transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
186
177
|
};
|
|
@@ -63,9 +63,6 @@ export default (function (pluginState, action) {
|
|
|
63
63
|
return pluginState;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
-
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
69
66
|
function getNewDraftState(pluginState, drafting, editorState, targetType, supportedBlockNodes, targetNodeId, isOpeningMediaCommentFromToolbar) {
|
|
70
67
|
var draftDecorationSet = pluginState.draftDecorationSet;
|
|
71
68
|
if (!draftDecorationSet || !drafting) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^99.
|
|
35
|
+
"@atlaskit/editor-common": "^99.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
37
37
|
"@atlaskit/editor-plugin-connectivity": "^1.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-viewmode-effects": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
41
|
-
"@atlaskit/icon": "^23.
|
|
42
|
-
"@atlaskit/onboarding": "^12.
|
|
41
|
+
"@atlaskit/icon": "^23.5.0",
|
|
42
|
+
"@atlaskit/onboarding": "^12.3.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^2.41.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@af/visual-regression": "*",
|
|
54
54
|
"@atlaskit/ssr": "*",
|
|
55
55
|
"@atlaskit/visual-regression": "*",
|
|
56
|
-
"@testing-library/react": "^
|
|
56
|
+
"@testing-library/react": "^13.4.0",
|
|
57
57
|
"typescript": "~5.4.2",
|
|
58
58
|
"wait-for-expect": "^1.2.0"
|
|
59
59
|
},
|