@atlaskit/editor-plugin-annotation 2.7.3 → 2.7.5
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 +12 -0
- package/dist/cjs/annotationPlugin.js +5 -2
- package/dist/cjs/pm-plugins/toolbar.js +6 -1
- package/dist/es2019/annotationPlugin.js +4 -2
- package/dist/es2019/pm-plugins/toolbar.js +6 -1
- package/dist/esm/annotationPlugin.js +5 -2
- package/dist/esm/pm-plugins/toolbar.js +6 -1
- package/dist/types/pm-plugins/toolbar.d.ts +2 -1
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/types/index.d.ts +2 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -99,14 +99,17 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
99
99
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
100
100
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
101
101
|
var _api$analytics4;
|
|
102
|
-
var
|
|
102
|
+
var _annotationProviders$ = annotationProviders.inlineComment,
|
|
103
|
+
isToolbarAbove = _annotationProviders$.isToolbarAbove,
|
|
104
|
+
onCommentButtonMount = _annotationProviders$.onCommentButtonMount;
|
|
103
105
|
var toolbarConfig = (0, _toolbar.buildToolbar)(api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)({
|
|
104
106
|
state: state,
|
|
105
107
|
intl: intl,
|
|
106
108
|
isToolbarAbove: isToolbarAbove,
|
|
107
109
|
api: api,
|
|
108
110
|
createCommentExperience: annotationProviders.createCommentExperience,
|
|
109
|
-
annotationManager: annotationProviders.annotationManager
|
|
111
|
+
annotationManager: annotationProviders.annotationManager,
|
|
112
|
+
onCommentButtonMount: onCommentButtonMount
|
|
110
113
|
});
|
|
111
114
|
if (!toolbarConfig) {
|
|
112
115
|
return undefined;
|
|
@@ -63,7 +63,8 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
|
|
|
63
63
|
_supportedNodes = _ref2$_supportedNodes === void 0 ? [] : _ref2$_supportedNodes,
|
|
64
64
|
api = _ref2.api,
|
|
65
65
|
createCommentExperience = _ref2.createCommentExperience,
|
|
66
|
-
annotationManager = _ref2.annotationManager
|
|
66
|
+
annotationManager = _ref2.annotationManager,
|
|
67
|
+
onCommentButtonMount = _ref2.onCommentButtonMount;
|
|
67
68
|
var schema = state.schema;
|
|
68
69
|
var selectionValid = (0, _utils2.isSelectionValid)(state);
|
|
69
70
|
var isMediaSelected = (0, _mediaSingle.currentMediaNodeWithPos)(state);
|
|
@@ -89,6 +90,10 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
|
|
|
89
90
|
title: createCommentMessage,
|
|
90
91
|
onMount: function onMount() {
|
|
91
92
|
var _getRangeInlineNodeNa;
|
|
93
|
+
if ((0, _platformFeatureFlags.fg)('confluence_frontend_preload_inline_comment_editor')) {
|
|
94
|
+
onCommentButtonMount && onCommentButtonMount();
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
// Check if the selection includes an non-text inline node
|
|
93
98
|
var inlineCommentPluginState = (0, _utils2.getPluginState)(state);
|
|
94
99
|
var inlineNodeNames = (_getRangeInlineNodeNa = (0, _utils.getRangeInlineNodeNames)({
|
|
@@ -90,7 +90,8 @@ export const annotationPlugin = ({
|
|
|
90
90
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
91
91
|
var _api$analytics4;
|
|
92
92
|
const {
|
|
93
|
-
isToolbarAbove
|
|
93
|
+
isToolbarAbove,
|
|
94
|
+
onCommentButtonMount
|
|
94
95
|
} = annotationProviders.inlineComment;
|
|
95
96
|
const toolbarConfig = buildToolbar(api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)({
|
|
96
97
|
state,
|
|
@@ -98,7 +99,8 @@ export const annotationPlugin = ({
|
|
|
98
99
|
isToolbarAbove,
|
|
99
100
|
api,
|
|
100
101
|
createCommentExperience: annotationProviders.createCommentExperience,
|
|
101
|
-
annotationManager: annotationProviders.annotationManager
|
|
102
|
+
annotationManager: annotationProviders.annotationManager,
|
|
103
|
+
onCommentButtonMount
|
|
102
104
|
});
|
|
103
105
|
if (!toolbarConfig) {
|
|
104
106
|
return undefined;
|
|
@@ -59,7 +59,8 @@ export const buildToolbar = editorAnalyticsAPI => ({
|
|
|
59
59
|
_supportedNodes = [],
|
|
60
60
|
api,
|
|
61
61
|
createCommentExperience,
|
|
62
|
-
annotationManager
|
|
62
|
+
annotationManager,
|
|
63
|
+
onCommentButtonMount
|
|
63
64
|
}) => {
|
|
64
65
|
var _api$connectivity, _api$connectivity$sha, _api$connectivity$sha2;
|
|
65
66
|
const {
|
|
@@ -89,6 +90,10 @@ export const buildToolbar = editorAnalyticsAPI => ({
|
|
|
89
90
|
title: createCommentMessage,
|
|
90
91
|
onMount: () => {
|
|
91
92
|
var _getRangeInlineNodeNa;
|
|
93
|
+
if (fg('confluence_frontend_preload_inline_comment_editor')) {
|
|
94
|
+
onCommentButtonMount && onCommentButtonMount();
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
// Check if the selection includes an non-text inline node
|
|
93
98
|
const inlineCommentPluginState = getPluginState(state);
|
|
94
99
|
const inlineNodeNames = (_getRangeInlineNodeNa = getRangeInlineNodeNames({
|
|
@@ -92,14 +92,17 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
92
92
|
var pluginState = getPluginState(state);
|
|
93
93
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
94
94
|
var _api$analytics4;
|
|
95
|
-
var
|
|
95
|
+
var _annotationProviders$ = annotationProviders.inlineComment,
|
|
96
|
+
isToolbarAbove = _annotationProviders$.isToolbarAbove,
|
|
97
|
+
onCommentButtonMount = _annotationProviders$.onCommentButtonMount;
|
|
96
98
|
var toolbarConfig = buildToolbar(api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)({
|
|
97
99
|
state: state,
|
|
98
100
|
intl: intl,
|
|
99
101
|
isToolbarAbove: isToolbarAbove,
|
|
100
102
|
api: api,
|
|
101
103
|
createCommentExperience: annotationProviders.createCommentExperience,
|
|
102
|
-
annotationManager: annotationProviders.annotationManager
|
|
104
|
+
annotationManager: annotationProviders.annotationManager,
|
|
105
|
+
onCommentButtonMount: onCommentButtonMount
|
|
103
106
|
});
|
|
104
107
|
if (!toolbarConfig) {
|
|
105
108
|
return undefined;
|
|
@@ -56,7 +56,8 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
|
|
|
56
56
|
_supportedNodes = _ref2$_supportedNodes === void 0 ? [] : _ref2$_supportedNodes,
|
|
57
57
|
api = _ref2.api,
|
|
58
58
|
createCommentExperience = _ref2.createCommentExperience,
|
|
59
|
-
annotationManager = _ref2.annotationManager
|
|
59
|
+
annotationManager = _ref2.annotationManager,
|
|
60
|
+
onCommentButtonMount = _ref2.onCommentButtonMount;
|
|
60
61
|
var schema = state.schema;
|
|
61
62
|
var selectionValid = isSelectionValid(state);
|
|
62
63
|
var isMediaSelected = currentMediaNodeWithPos(state);
|
|
@@ -82,6 +83,10 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
|
|
|
82
83
|
title: createCommentMessage,
|
|
83
84
|
onMount: function onMount() {
|
|
84
85
|
var _getRangeInlineNodeNa;
|
|
86
|
+
if (fg('confluence_frontend_preload_inline_comment_editor')) {
|
|
87
|
+
onCommentButtonMount && onCommentButtonMount();
|
|
88
|
+
}
|
|
89
|
+
|
|
85
90
|
// Check if the selection includes an non-text inline node
|
|
86
91
|
var inlineCommentPluginState = getPluginState(state);
|
|
87
92
|
var inlineNodeNames = (_getRangeInlineNodeNa = getRangeInlineNodeNames({
|
|
@@ -16,6 +16,7 @@ interface BuildToolbarOptions {
|
|
|
16
16
|
api?: ExtractInjectionAPI<AnnotationPlugin>;
|
|
17
17
|
createCommentExperience?: AnnotationProviders['createCommentExperience'];
|
|
18
18
|
annotationManager?: AnnotationProviders['annotationManager'];
|
|
19
|
+
onCommentButtonMount?: () => void;
|
|
19
20
|
}
|
|
20
21
|
export declare const getValidNodes: (state: EditorState) => NodeType[];
|
|
21
22
|
type ShouldSuppressFloatingToolbarOptions = {
|
|
@@ -35,7 +36,7 @@ export declare const buildSuppressedToolbar: (state: EditorState) => {
|
|
|
35
36
|
title: string;
|
|
36
37
|
__suppressAllToolbars: boolean;
|
|
37
38
|
};
|
|
38
|
-
export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, }: BuildToolbarOptions) => {
|
|
39
|
+
export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, onCommentButtonMount, }: BuildToolbarOptions) => {
|
|
39
40
|
title: string;
|
|
40
41
|
nodeType: NodeType[];
|
|
41
42
|
items: FloatingToolbarButton<Command>[];
|
|
@@ -102,6 +102,7 @@ export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationT
|
|
|
102
102
|
* Note 2: text is supported by default.
|
|
103
103
|
*/
|
|
104
104
|
supportedBlockNodes?: string[];
|
|
105
|
+
onCommentButtonMount?: () => void;
|
|
105
106
|
};
|
|
106
107
|
export interface AnnotationProviders {
|
|
107
108
|
inlineComment: InlineCommentAnnotationProvider;
|
|
@@ -199,6 +200,7 @@ export type InlineCommentCompoundExperience = {
|
|
|
199
200
|
}) => void;
|
|
200
201
|
complete: () => void;
|
|
201
202
|
debug: ExperienceDebugFunction;
|
|
203
|
+
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
202
204
|
};
|
|
203
205
|
draftToPublishExperience: {
|
|
204
206
|
start: () => void;
|
|
@@ -16,6 +16,7 @@ interface BuildToolbarOptions {
|
|
|
16
16
|
api?: ExtractInjectionAPI<AnnotationPlugin>;
|
|
17
17
|
createCommentExperience?: AnnotationProviders['createCommentExperience'];
|
|
18
18
|
annotationManager?: AnnotationProviders['annotationManager'];
|
|
19
|
+
onCommentButtonMount?: () => void;
|
|
19
20
|
}
|
|
20
21
|
export declare const getValidNodes: (state: EditorState) => NodeType[];
|
|
21
22
|
type ShouldSuppressFloatingToolbarOptions = {
|
|
@@ -35,7 +36,7 @@ export declare const buildSuppressedToolbar: (state: EditorState) => {
|
|
|
35
36
|
title: string;
|
|
36
37
|
__suppressAllToolbars: boolean;
|
|
37
38
|
};
|
|
38
|
-
export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, }: BuildToolbarOptions) => {
|
|
39
|
+
export declare const buildToolbar: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ state, intl, isToolbarAbove, _supportedNodes, api, createCommentExperience, annotationManager, onCommentButtonMount, }: BuildToolbarOptions) => {
|
|
39
40
|
title: string;
|
|
40
41
|
nodeType: NodeType[];
|
|
41
42
|
items: FloatingToolbarButton<Command>[];
|
|
@@ -102,6 +102,7 @@ export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationT
|
|
|
102
102
|
* Note 2: text is supported by default.
|
|
103
103
|
*/
|
|
104
104
|
supportedBlockNodes?: string[];
|
|
105
|
+
onCommentButtonMount?: () => void;
|
|
105
106
|
};
|
|
106
107
|
export interface AnnotationProviders {
|
|
107
108
|
inlineComment: InlineCommentAnnotationProvider;
|
|
@@ -199,6 +200,7 @@ export type InlineCommentCompoundExperience = {
|
|
|
199
200
|
}) => void;
|
|
200
201
|
complete: () => void;
|
|
201
202
|
debug: ExperienceDebugFunction;
|
|
203
|
+
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
202
204
|
};
|
|
203
205
|
draftToPublishExperience: {
|
|
204
206
|
start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.5",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
36
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^104.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode-effects": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/icon": "^
|
|
42
|
+
"@atlaskit/icon": "^26.0.0",
|
|
43
43
|
"@atlaskit/onboarding": "^14.0.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^4.19.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -120,6 +120,9 @@
|
|
|
120
120
|
},
|
|
121
121
|
"confluence_frontend_handle_annotation_error": {
|
|
122
122
|
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"confluence_frontend_preload_inline_comment_editor": {
|
|
125
|
+
"type": "boolean"
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
}
|