@atlaskit/editor-plugin-annotation 1.10.2 → 1.10.4
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 +48 -0
- package/dist/cjs/commands/index.js +1 -1
- package/dist/cjs/commands/transform.js +25 -2
- package/dist/es2019/commands/index.js +1 -1
- package/dist/es2019/commands/transform.js +20 -2
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/commands/transform.js +25 -2
- package/dist/types/commands/transform.d.ts +27 -22
- package/dist/types/types.d.ts +2 -2
- package/dist/types-ts4.5/commands/transform.d.ts +33 -24
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/package.json +33 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 1.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#108237](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108237)
|
|
8
|
+
[`ea7dd8ebb249e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ea7dd8ebb249e) -
|
|
9
|
+
Split out side-effects from viewmode plugin to seperate plugin to reduce cyclical dependency risk
|
|
10
|
+
|
|
11
|
+
# WHAT
|
|
12
|
+
|
|
13
|
+
- Remove `createFilterStepsPlugin` from the editorViewMode Plugin and is implemented in
|
|
14
|
+
editorViewModeEffects instead.
|
|
15
|
+
- Remove `appendTransaction` from the editorViewMode plugin and add as a new PMPlugin in
|
|
16
|
+
editorViewModeEffects
|
|
17
|
+
- `applyViewModeStepAt` is moved to editorViewModeEffects. This is currently only used in
|
|
18
|
+
Annotation plugin which now consumes the new plugin instead and has a minor bump.
|
|
19
|
+
|
|
20
|
+
# WHY
|
|
21
|
+
|
|
22
|
+
ViewMode information is needed for upstream work in the CollabEdit plugin (see ED-23466).
|
|
23
|
+
Currently the viewMode plugin already depends on CollabEdit and as such implementing new work
|
|
24
|
+
causes a cylical dependency problem. ViewMode is likely to be required in an increasing number of
|
|
25
|
+
plugins and ideally should be as pure as possible with no dependencies. A larger rethink of how
|
|
26
|
+
these plugins fit together may be required but that is outside the scope of this change.
|
|
27
|
+
|
|
28
|
+
# HOW
|
|
29
|
+
|
|
30
|
+
All incompatibilities should be addressed within this changeset, however for the sake of
|
|
31
|
+
completeness:
|
|
32
|
+
|
|
33
|
+
- `editor-plugin-editor-viewmode-effects` must be added to any preset that relies on the viewmode
|
|
34
|
+
filter steps plugin for viewmode annotations. Currently this seems to only be the confluence
|
|
35
|
+
editor itself.
|
|
36
|
+
- `applyViewModeStepAt` should now be called from the `editorViewModeEffects` plugin. This will
|
|
37
|
+
need to be added to your plugin types independently (all uses covered by this change)
|
|
38
|
+
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
|
|
41
|
+
## 1.10.3
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [#110714](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110714)
|
|
46
|
+
[`9e5e71458aec6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9e5e71458aec6) -
|
|
47
|
+
[ED-23281] Explictly opt out scrollIntoView when adding annotation mark as it is handled by
|
|
48
|
+
scrolling comment sidebar into view instead
|
|
49
|
+
- Updated dependencies
|
|
50
|
+
|
|
3
51
|
## 1.10.2
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -179,7 +179,7 @@ var setInlineCommentDraftState = exports.setInlineCommentDraftState = function s
|
|
|
179
179
|
var isCommentOnMediaOn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
180
180
|
var targetNodeId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
181
181
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, isCommentOnMediaOn, supportedBlockNodes);
|
|
182
|
-
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.
|
|
182
|
+
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
var addInlineComment = exports.addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI) {
|
|
@@ -42,14 +42,20 @@ var addAnnotationMark = function addAnnotationMark(id, supportedBlockNodes) {
|
|
|
42
42
|
var addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI) {
|
|
43
43
|
return function (id, supportedBlockNodes) {
|
|
44
44
|
return function (transaction, state) {
|
|
45
|
-
var _editorAPI$editorView;
|
|
45
|
+
var _editorAPI$editorView, _pluginState$featureF;
|
|
46
46
|
var tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
|
|
47
|
-
editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.
|
|
47
|
+
editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
|
|
48
48
|
|
|
49
49
|
// add insert analytics step to transaction
|
|
50
50
|
tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
|
|
51
51
|
// add close analytics step to transaction
|
|
52
52
|
tr = addOpenCloseAnalytics(editorAnalyticsAPI)(false, _analytics.INPUT_METHOD.TOOLBAR)(tr, state);
|
|
53
|
+
var pluginState = (0, _utils2.getPluginState)(state);
|
|
54
|
+
var isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 || (_pluginState$featureF = pluginState.featureFlagsPluginState) === null || _pluginState$featureF === void 0 ? void 0 : _pluginState$featureF.commentsOnMediaAutoscrollInEditor;
|
|
55
|
+
if (isAutoScrollBugFixEnabled) {
|
|
56
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
57
|
+
tr.setMeta('scrollIntoView', false);
|
|
58
|
+
}
|
|
53
59
|
return tr;
|
|
54
60
|
};
|
|
55
61
|
};
|
|
@@ -64,6 +70,22 @@ var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
|
64
70
|
};
|
|
65
71
|
};
|
|
66
72
|
};
|
|
73
|
+
var handleDraftState = function handleDraftState(editorAnalyticsAPI) {
|
|
74
|
+
return function (drafting) {
|
|
75
|
+
var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
76
|
+
return function (transaction, state) {
|
|
77
|
+
var _pluginState$featureF2;
|
|
78
|
+
var tr = addOpenCloseAnalytics(editorAnalyticsAPI)(drafting, method)(transaction, state);
|
|
79
|
+
var pluginState = (0, _utils2.getPluginState)(state);
|
|
80
|
+
var isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 || (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaAutoscrollInEditor;
|
|
81
|
+
if (isAutoScrollBugFixEnabled) {
|
|
82
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
83
|
+
tr.setMeta('scrollIntoView', false);
|
|
84
|
+
}
|
|
85
|
+
return tr;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
67
89
|
var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
68
90
|
return function (transaction, state) {
|
|
69
91
|
var analyticsEvent = {
|
|
@@ -109,6 +131,7 @@ var addResolveAnalytics = function addResolveAnalytics(editorAnalyticsAPI) {
|
|
|
109
131
|
var _default = exports.default = {
|
|
110
132
|
addAnnotationMark: addAnnotationMark,
|
|
111
133
|
addInlineComment: addInlineComment,
|
|
134
|
+
handleDraftState: handleDraftState,
|
|
112
135
|
addOpenCloseAnalytics: addOpenCloseAnalytics,
|
|
113
136
|
addInsertAnalytics: addInsertAnalytics,
|
|
114
137
|
addResolveAnalytics: addResolveAnalytics
|
|
@@ -148,7 +148,7 @@ export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => (node
|
|
|
148
148
|
};
|
|
149
149
|
export const setInlineCommentDraftState = (editorAnalyticsAPI, supportedBlockNodes = []) => (drafting, inputMethod = INPUT_METHOD.TOOLBAR, targetType = 'inline', isCommentOnMediaOn = false, targetNodeId = undefined) => {
|
|
150
150
|
const commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, isCommentOnMediaOn, supportedBlockNodes);
|
|
151
|
-
return createCommand(commandAction, transform.
|
|
151
|
+
return createCommand(commandAction, transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
152
152
|
};
|
|
153
153
|
export const addInlineComment = (editorAnalyticsAPI, editorAPI) => (id, supportedBlockNodes) => {
|
|
154
154
|
const commandAction = editorState => ({
|
|
@@ -34,14 +34,20 @@ const addAnnotationMark = (id, supportedBlockNodes) => (transaction, state) => {
|
|
|
34
34
|
return tr;
|
|
35
35
|
};
|
|
36
36
|
const addInlineComment = (editorAnalyticsAPI, editorAPI) => (id, supportedBlockNodes) => (transaction, state) => {
|
|
37
|
-
var _editorAPI$editorView;
|
|
37
|
+
var _editorAPI$editorView, _pluginState$featureF;
|
|
38
38
|
let tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
|
|
39
|
-
editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$editorView = editorAPI.
|
|
39
|
+
editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 ? void 0 : _editorAPI$editorView.actions.applyViewModeStepAt(tr);
|
|
40
40
|
|
|
41
41
|
// add insert analytics step to transaction
|
|
42
42
|
tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
|
|
43
43
|
// add close analytics step to transaction
|
|
44
44
|
tr = addOpenCloseAnalytics(editorAnalyticsAPI)(false, INPUT_METHOD.TOOLBAR)(tr, state);
|
|
45
|
+
const pluginState = getPluginState(state);
|
|
46
|
+
const isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$featureF = pluginState.featureFlagsPluginState) === null || _pluginState$featureF === void 0 ? void 0 : _pluginState$featureF.commentsOnMediaAutoscrollInEditor;
|
|
47
|
+
if (isAutoScrollBugFixEnabled) {
|
|
48
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
49
|
+
tr.setMeta('scrollIntoView', false);
|
|
50
|
+
}
|
|
45
51
|
return tr;
|
|
46
52
|
};
|
|
47
53
|
const addOpenCloseAnalytics = editorAnalyticsAPI => (drafting, method = INPUT_METHOD.TOOLBAR) => (transaction, state) => {
|
|
@@ -49,6 +55,17 @@ const addOpenCloseAnalytics = editorAnalyticsAPI => (drafting, method = INPUT_ME
|
|
|
49
55
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(draftingPayload)(transaction);
|
|
50
56
|
return transaction;
|
|
51
57
|
};
|
|
58
|
+
const handleDraftState = editorAnalyticsAPI => (drafting, method = INPUT_METHOD.TOOLBAR) => (transaction, state) => {
|
|
59
|
+
var _pluginState$featureF2;
|
|
60
|
+
const tr = addOpenCloseAnalytics(editorAnalyticsAPI)(drafting, method)(transaction, state);
|
|
61
|
+
const pluginState = getPluginState(state);
|
|
62
|
+
const isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaAutoscrollInEditor;
|
|
63
|
+
if (isAutoScrollBugFixEnabled) {
|
|
64
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
65
|
+
tr.setMeta('scrollIntoView', false);
|
|
66
|
+
}
|
|
67
|
+
return tr;
|
|
68
|
+
};
|
|
52
69
|
const addInsertAnalytics = editorAnalyticsAPI => (transaction, state) => {
|
|
53
70
|
const analyticsEvent = {
|
|
54
71
|
action: ACTION.INSERTED,
|
|
@@ -89,6 +106,7 @@ const addResolveAnalytics = editorAnalyticsAPI => method => (transaction, state)
|
|
|
89
106
|
export default {
|
|
90
107
|
addAnnotationMark,
|
|
91
108
|
addInlineComment,
|
|
109
|
+
handleDraftState,
|
|
92
110
|
addOpenCloseAnalytics,
|
|
93
111
|
addInsertAnalytics,
|
|
94
112
|
addResolveAnalytics
|
|
@@ -172,7 +172,7 @@ export var setInlineCommentDraftState = function setInlineCommentDraftState(edit
|
|
|
172
172
|
var isCommentOnMediaOn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
173
173
|
var targetNodeId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
174
174
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, isCommentOnMediaOn, supportedBlockNodes);
|
|
175
|
-
return createCommand(commandAction, transform.
|
|
175
|
+
return createCommand(commandAction, transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod));
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
export var addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI) {
|
|
@@ -36,14 +36,20 @@ var addAnnotationMark = function addAnnotationMark(id, supportedBlockNodes) {
|
|
|
36
36
|
var addInlineComment = function addInlineComment(editorAnalyticsAPI, editorAPI) {
|
|
37
37
|
return function (id, supportedBlockNodes) {
|
|
38
38
|
return function (transaction, state) {
|
|
39
|
-
var _editorAPI$editorView;
|
|
39
|
+
var _editorAPI$editorView, _pluginState$featureF;
|
|
40
40
|
var tr = addAnnotationMark(id, supportedBlockNodes)(transaction, state);
|
|
41
|
-
editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.
|
|
41
|
+
editorAPI === null || editorAPI === void 0 || (_editorAPI$editorView = editorAPI.editorViewModeEffects) === null || _editorAPI$editorView === void 0 || _editorAPI$editorView.actions.applyViewModeStepAt(tr);
|
|
42
42
|
|
|
43
43
|
// add insert analytics step to transaction
|
|
44
44
|
tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
|
|
45
45
|
// add close analytics step to transaction
|
|
46
46
|
tr = addOpenCloseAnalytics(editorAnalyticsAPI)(false, INPUT_METHOD.TOOLBAR)(tr, state);
|
|
47
|
+
var pluginState = getPluginState(state);
|
|
48
|
+
var isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 || (_pluginState$featureF = pluginState.featureFlagsPluginState) === null || _pluginState$featureF === void 0 ? void 0 : _pluginState$featureF.commentsOnMediaAutoscrollInEditor;
|
|
49
|
+
if (isAutoScrollBugFixEnabled) {
|
|
50
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
51
|
+
tr.setMeta('scrollIntoView', false);
|
|
52
|
+
}
|
|
47
53
|
return tr;
|
|
48
54
|
};
|
|
49
55
|
};
|
|
@@ -58,6 +64,22 @@ var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
|
58
64
|
};
|
|
59
65
|
};
|
|
60
66
|
};
|
|
67
|
+
var handleDraftState = function handleDraftState(editorAnalyticsAPI) {
|
|
68
|
+
return function (drafting) {
|
|
69
|
+
var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INPUT_METHOD.TOOLBAR;
|
|
70
|
+
return function (transaction, state) {
|
|
71
|
+
var _pluginState$featureF2;
|
|
72
|
+
var tr = addOpenCloseAnalytics(editorAnalyticsAPI)(drafting, method)(transaction, state);
|
|
73
|
+
var pluginState = getPluginState(state);
|
|
74
|
+
var isAutoScrollBugFixEnabled = pluginState === null || pluginState === void 0 || (_pluginState$featureF2 = pluginState.featureFlagsPluginState) === null || _pluginState$featureF2 === void 0 ? void 0 : _pluginState$featureF2.commentsOnMediaAutoscrollInEditor;
|
|
75
|
+
if (isAutoScrollBugFixEnabled) {
|
|
76
|
+
// Explicitly disable scrollIntoView as scrolling is handled by CommentSidebar
|
|
77
|
+
tr.setMeta('scrollIntoView', false);
|
|
78
|
+
}
|
|
79
|
+
return tr;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
61
83
|
var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
62
84
|
return function (transaction, state) {
|
|
63
85
|
var analyticsEvent = {
|
|
@@ -103,6 +125,7 @@ var addResolveAnalytics = function addResolveAnalytics(editorAnalyticsAPI) {
|
|
|
103
125
|
export default {
|
|
104
126
|
addAnnotationMark: addAnnotationMark,
|
|
105
127
|
addInlineComment: addInlineComment,
|
|
128
|
+
handleDraftState: handleDraftState,
|
|
106
129
|
addOpenCloseAnalytics: addOpenCloseAnalytics,
|
|
107
130
|
addInsertAnalytics: addInsertAnalytics,
|
|
108
131
|
addResolveAnalytics: addResolveAnalytics
|
|
@@ -18,8 +18,7 @@ declare const _default: {
|
|
|
18
18
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
19
19
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
20
20
|
actions: EditorAnalyticsAPI;
|
|
21
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
22
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
21
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
|
|
23
22
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
24
23
|
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
25
24
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
@@ -55,19 +54,22 @@ declare const _default: {
|
|
|
55
54
|
}) => boolean;
|
|
56
55
|
isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
|
|
57
56
|
};
|
|
58
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions
|
|
59
|
-
|
|
57
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
58
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
59
|
+
dependencies: [];
|
|
60
|
+
pluginConfiguration?: {
|
|
61
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
commands: {
|
|
64
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
65
|
+
};
|
|
66
|
+
}, {
|
|
60
67
|
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
61
|
-
} | undefined;
|
|
62
|
-
commands: {
|
|
63
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
64
|
-
};
|
|
68
|
+
} | undefined>];
|
|
65
69
|
actions: {
|
|
66
70
|
applyViewModeStepAt: (tr: Transaction) => boolean;
|
|
67
71
|
};
|
|
68
|
-
}, {
|
|
69
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
70
|
-
} | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
72
|
+
}, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
71
73
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
72
74
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
73
75
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
@@ -88,8 +90,7 @@ declare const _default: {
|
|
|
88
90
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
89
91
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>];
|
|
90
92
|
actions: EditorAnalyticsAPI;
|
|
91
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
92
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
93
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
|
|
93
94
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
94
95
|
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
95
96
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
@@ -125,22 +126,26 @@ declare const _default: {
|
|
|
125
126
|
}) => boolean;
|
|
126
127
|
isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
|
|
127
128
|
};
|
|
128
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions
|
|
129
|
-
|
|
129
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
130
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
131
|
+
dependencies: [];
|
|
132
|
+
pluginConfiguration?: {
|
|
133
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
commands: {
|
|
136
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
137
|
+
};
|
|
138
|
+
}, {
|
|
130
139
|
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
131
|
-
} | undefined;
|
|
132
|
-
commands: {
|
|
133
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
134
|
-
};
|
|
140
|
+
} | undefined>];
|
|
135
141
|
actions: {
|
|
136
142
|
applyViewModeStepAt: (tr: Transaction) => boolean;
|
|
137
143
|
};
|
|
138
|
-
}, {
|
|
139
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
140
|
-
} | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
144
|
+
}, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
141
145
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
142
146
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
143
147
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>]> | undefined) => (id: string, supportedBlockNodes?: string[] | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
148
|
+
handleDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (drafting: boolean, method?: InlineCommentInputMethod) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
144
149
|
addOpenCloseAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (drafting: boolean, method?: InlineCommentInputMethod) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
145
150
|
addInsertAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
146
151
|
addResolveAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (method?: RESOLVE_METHOD | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import type { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
5
5
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
|
-
import type {
|
|
7
|
+
import type { EditorViewModeEffectsPlugin } from '@atlaskit/editor-plugin-editor-viewmode-effects';
|
|
8
8
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
9
|
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -30,7 +30,7 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
|
30
30
|
sharedState: InlineCommentPluginState | undefined;
|
|
31
31
|
dependencies: [
|
|
32
32
|
OptionalPlugin<AnalyticsPlugin>,
|
|
33
|
-
OptionalPlugin<
|
|
33
|
+
OptionalPlugin<EditorViewModeEffectsPlugin>,
|
|
34
34
|
OptionalPlugin<FeatureFlagsPlugin>
|
|
35
35
|
];
|
|
36
36
|
actions: {
|
|
@@ -23,8 +23,7 @@ declare const _default: {
|
|
|
23
23
|
];
|
|
24
24
|
actions: EditorAnalyticsAPI;
|
|
25
25
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
26
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
27
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
26
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
|
|
28
27
|
dependencies: [
|
|
29
28
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
30
29
|
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
@@ -66,20 +65,25 @@ declare const _default: {
|
|
|
66
65
|
}) => boolean;
|
|
67
66
|
isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
|
|
68
67
|
};
|
|
69
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions
|
|
68
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>,
|
|
69
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
70
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
71
|
+
dependencies: [
|
|
72
|
+
];
|
|
73
|
+
pluginConfiguration?: {
|
|
74
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
commands: {
|
|
77
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
78
|
+
};
|
|
79
|
+
}, {
|
|
80
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
81
|
+
} | undefined>
|
|
70
82
|
];
|
|
71
|
-
pluginConfiguration?: {
|
|
72
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
73
|
-
} | undefined;
|
|
74
|
-
commands: {
|
|
75
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
76
|
-
};
|
|
77
83
|
actions: {
|
|
78
84
|
applyViewModeStepAt: (tr: Transaction) => boolean;
|
|
79
85
|
};
|
|
80
|
-
},
|
|
81
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
82
|
-
} | undefined>>,
|
|
86
|
+
}, undefined>>,
|
|
83
87
|
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
84
88
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
85
89
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
@@ -106,8 +110,7 @@ declare const _default: {
|
|
|
106
110
|
];
|
|
107
111
|
actions: EditorAnalyticsAPI;
|
|
108
112
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
109
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
110
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
113
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewModeEffects", {
|
|
111
114
|
dependencies: [
|
|
112
115
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"collabEdit", {
|
|
113
116
|
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
@@ -149,25 +152,31 @@ declare const _default: {
|
|
|
149
152
|
}) => boolean;
|
|
150
153
|
isRemoteReplaceDocumentTransaction: (tr: Transaction) => boolean;
|
|
151
154
|
};
|
|
152
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions
|
|
155
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>,
|
|
156
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorViewMode", {
|
|
157
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
158
|
+
dependencies: [
|
|
159
|
+
];
|
|
160
|
+
pluginConfiguration?: {
|
|
161
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
commands: {
|
|
164
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
165
|
+
};
|
|
166
|
+
}, {
|
|
167
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
168
|
+
} | undefined>
|
|
153
169
|
];
|
|
154
|
-
pluginConfiguration?: {
|
|
155
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
156
|
-
} | undefined;
|
|
157
|
-
commands: {
|
|
158
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
159
|
-
};
|
|
160
170
|
actions: {
|
|
161
171
|
applyViewModeStepAt: (tr: Transaction) => boolean;
|
|
162
172
|
};
|
|
163
|
-
},
|
|
164
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
165
|
-
} | undefined>>,
|
|
173
|
+
}, undefined>>,
|
|
166
174
|
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
167
175
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
168
176
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
169
177
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
170
178
|
]> | undefined) => (id: string, supportedBlockNodes?: string[] | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
179
|
+
handleDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (drafting: boolean, method?: InlineCommentInputMethod) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
171
180
|
addOpenCloseAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (drafting: boolean, method?: InlineCommentInputMethod) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
172
181
|
addInsertAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
173
182
|
addResolveAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (method?: RESOLVE_METHOD | undefined) => (transaction: Transaction, state: EditorState) => Transaction;
|
|
@@ -4,7 +4,7 @@ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import type { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
5
5
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
|
-
import type {
|
|
7
|
+
import type { EditorViewModeEffectsPlugin } from '@atlaskit/editor-plugin-editor-viewmode-effects';
|
|
8
8
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
9
|
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -30,7 +30,7 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
|
|
|
30
30
|
sharedState: InlineCommentPluginState | undefined;
|
|
31
31
|
dependencies: [
|
|
32
32
|
OptionalPlugin<AnalyticsPlugin>,
|
|
33
|
-
OptionalPlugin<
|
|
33
|
+
OptionalPlugin<EditorViewModeEffectsPlugin>,
|
|
34
34
|
OptionalPlugin<FeatureFlagsPlugin>
|
|
35
35
|
];
|
|
36
36
|
actions: {
|
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.4",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"types": "dist/types/index.d.ts",
|
|
21
21
|
"typesVersions": {
|
|
22
22
|
">=4.5 <4.9": {
|
|
23
|
-
"*": [
|
|
23
|
+
"*": [
|
|
24
|
+
"dist/types-ts4.5/*",
|
|
25
|
+
"dist/types-ts4.5/index.d.ts"
|
|
26
|
+
]
|
|
24
27
|
}
|
|
25
28
|
},
|
|
26
29
|
"sideEffects": false,
|
|
@@ -30,12 +33,12 @@
|
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
32
35
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
33
|
-
"@atlaskit/editor-common": "^82.
|
|
36
|
+
"@atlaskit/editor-common": "^82.9.0",
|
|
34
37
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
35
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^1.
|
|
38
|
+
"@atlaskit/editor-plugin-editor-viewmode-effects": "^1.0.0",
|
|
36
39
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
37
40
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
38
|
-
"@atlaskit/icon": "^22.
|
|
41
|
+
"@atlaskit/icon": "^22.4.0",
|
|
39
42
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
40
43
|
"@babel/runtime": "^7.0.0"
|
|
41
44
|
},
|
|
@@ -55,18 +58,35 @@
|
|
|
55
58
|
},
|
|
56
59
|
"techstack": {
|
|
57
60
|
"@atlassian/frontend": {
|
|
58
|
-
"import-structure": [
|
|
59
|
-
|
|
61
|
+
"import-structure": [
|
|
62
|
+
"atlassian-conventions"
|
|
63
|
+
],
|
|
64
|
+
"circular-dependencies": [
|
|
65
|
+
"file-and-folder-level"
|
|
66
|
+
]
|
|
60
67
|
},
|
|
61
68
|
"@repo/internal": {
|
|
62
69
|
"dom-events": "use-bind-event-listener",
|
|
63
|
-
"analytics": [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
70
|
+
"analytics": [
|
|
71
|
+
"analytics-next"
|
|
72
|
+
],
|
|
73
|
+
"design-tokens": [
|
|
74
|
+
"color"
|
|
75
|
+
],
|
|
76
|
+
"theming": [
|
|
77
|
+
"react-context"
|
|
78
|
+
],
|
|
79
|
+
"ui-components": [
|
|
80
|
+
"lite-mode"
|
|
81
|
+
],
|
|
67
82
|
"deprecation": "no-deprecated-imports",
|
|
68
|
-
"styling": [
|
|
69
|
-
|
|
83
|
+
"styling": [
|
|
84
|
+
"emotion",
|
|
85
|
+
"emotion"
|
|
86
|
+
],
|
|
87
|
+
"imports": [
|
|
88
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
89
|
+
]
|
|
70
90
|
}
|
|
71
91
|
},
|
|
72
92
|
"platform-feature-flags": {
|