@atlaskit/editor-plugin-annotation 2.9.3 → 2.9.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 +10 -0
- package/dist/cjs/annotationPlugin.js +1 -0
- package/dist/cjs/pm-plugins/inline-comment.js +8 -1
- package/dist/cjs/types/index.js +1 -6
- package/dist/es2019/annotationPlugin.js +1 -0
- package/dist/es2019/pm-plugins/inline-comment.js +8 -1
- package/dist/es2019/types/index.js +1 -6
- package/dist/esm/annotationPlugin.js +1 -0
- package/dist/esm/pm-plugins/inline-comment.js +8 -1
- package/dist/esm/types/index.js +1 -6
- package/dist/types/index.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -0
- package/dist/types/types/index.d.ts +23 -136
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +23 -136
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 2.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#144021](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/144021)
|
|
8
|
+
[`8357b7ad2daa6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8357b7ad2daa6) -
|
|
9
|
+
Added config option for starting viewInlineCommentTraceUFOPress for inline-comments
|
|
10
|
+
annotationPlugin
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 2.9.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -61,6 +61,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
61
61
|
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
62
62
|
featureFlagsPluginState: featureFlags,
|
|
63
63
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
64
|
+
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
64
65
|
annotationManager: annotationProviders.annotationManager,
|
|
65
66
|
api: api
|
|
66
67
|
});
|
|
@@ -266,16 +266,23 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
266
266
|
var _ref5 = (0, _utils2.getPluginState)(_prevState) || {},
|
|
267
267
|
prevSelectedAnnotations = _ref5.selectedAnnotations;
|
|
268
268
|
var selectedAnnotationId = selectedAnnotations && selectedAnnotations.length !== 0 && selectedAnnotations[0].id ? selectedAnnotations[0].id : undefined;
|
|
269
|
+
|
|
269
270
|
// If the new state has an unresolved selected annotation, and it's different from
|
|
270
|
-
// the previous one then
|
|
271
|
+
// the previous one then...
|
|
271
272
|
if (
|
|
272
273
|
//This checks the selected annotation is different from the previous one
|
|
273
274
|
selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 || (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
|
|
274
275
|
// This ensures that the selected annotation is unresolved
|
|
275
276
|
annotations && annotations[selectedAnnotationId] === false) {
|
|
276
277
|
var _options$selectCommen;
|
|
278
|
+
// ...we mark the select annotation experience as complete.
|
|
277
279
|
// The selectComponentExperience is using a simplified object, which is why it's type asserted.
|
|
278
280
|
(_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 || _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
|
|
281
|
+
if ((0, _platformFeatureFlags.fg)('cc_comments_track_view_inline_comment_action')) {
|
|
282
|
+
var _options$viewInlineCo;
|
|
283
|
+
// ...and start a new UFO press trace since the selected comment is changing
|
|
284
|
+
(_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
|
|
285
|
+
}
|
|
279
286
|
}
|
|
280
287
|
if (annotationManager) {
|
|
281
288
|
// In the Editor, Annotations can be selected in three ways:
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -26,9 +26,4 @@ var AnnotationTestIds = exports.AnnotationTestIds = {
|
|
|
26
26
|
floatingToolbarCreateButton: "".concat(prefix, "-toolbar-create-button"),
|
|
27
27
|
componentSave: "".concat(prefix, "-dummy-save-button"),
|
|
28
28
|
componentClose: "".concat(prefix, "-dummy-close-button")
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Alternative to SelectInlineCommentCompoundExperience, used for the annotation plugin options
|
|
33
|
-
* in the confluence editor presets. See createFullPageEditorPreset.ts or annotationPluginOptions.ts for usage.
|
|
34
|
-
*/
|
|
29
|
+
};
|
|
@@ -52,6 +52,7 @@ export const annotationPlugin = ({
|
|
|
52
52
|
editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
53
53
|
featureFlagsPluginState: featureFlags,
|
|
54
54
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
55
|
+
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
55
56
|
annotationManager: annotationProviders.annotationManager,
|
|
56
57
|
api
|
|
57
58
|
});
|
|
@@ -201,16 +201,23 @@ export const inlineCommentPlugin = options => {
|
|
|
201
201
|
selectedAnnotations: prevSelectedAnnotations
|
|
202
202
|
} = getPluginState(_prevState) || {};
|
|
203
203
|
const selectedAnnotationId = selectedAnnotations && selectedAnnotations.length !== 0 && selectedAnnotations[0].id ? selectedAnnotations[0].id : undefined;
|
|
204
|
+
|
|
204
205
|
// If the new state has an unresolved selected annotation, and it's different from
|
|
205
|
-
// the previous one then
|
|
206
|
+
// the previous one then...
|
|
206
207
|
if (
|
|
207
208
|
//This checks the selected annotation is different from the previous one
|
|
208
209
|
selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 ? void 0 : (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
|
|
209
210
|
// This ensures that the selected annotation is unresolved
|
|
210
211
|
annotations && annotations[selectedAnnotationId] === false) {
|
|
211
212
|
var _options$selectCommen;
|
|
213
|
+
// ...we mark the select annotation experience as complete.
|
|
212
214
|
// The selectComponentExperience is using a simplified object, which is why it's type asserted.
|
|
213
215
|
(_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 ? void 0 : _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
|
|
216
|
+
if (fg('cc_comments_track_view_inline_comment_action')) {
|
|
217
|
+
var _options$viewInlineCo;
|
|
218
|
+
// ...and start a new UFO press trace since the selected comment is changing
|
|
219
|
+
(_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 ? void 0 : _options$viewInlineCo.call(options);
|
|
220
|
+
}
|
|
214
221
|
}
|
|
215
222
|
if (annotationManager) {
|
|
216
223
|
// In the Editor, Annotations can be selected in three ways:
|
|
@@ -22,9 +22,4 @@ export const AnnotationTestIds = {
|
|
|
22
22
|
floatingToolbarCreateButton: `${prefix}-toolbar-create-button`,
|
|
23
23
|
componentSave: `${prefix}-dummy-save-button`,
|
|
24
24
|
componentClose: `${prefix}-dummy-close-button`
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Alternative to SelectInlineCommentCompoundExperience, used for the annotation plugin options
|
|
29
|
-
* in the confluence editor presets. See createFullPageEditorPreset.ts or annotationPluginOptions.ts for usage.
|
|
30
|
-
*/
|
|
25
|
+
};
|
|
@@ -54,6 +54,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
54
54
|
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions,
|
|
55
55
|
featureFlagsPluginState: featureFlags,
|
|
56
56
|
selectCommentExperience: annotationProviders.selectCommentExperience,
|
|
57
|
+
viewInlineCommentTraceUFOPress: annotationProviders.viewInlineCommentTraceUFOPress,
|
|
57
58
|
annotationManager: annotationProviders.annotationManager,
|
|
58
59
|
api: api
|
|
59
60
|
});
|
|
@@ -259,16 +259,23 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
|
|
|
259
259
|
var _ref5 = getPluginState(_prevState) || {},
|
|
260
260
|
prevSelectedAnnotations = _ref5.selectedAnnotations;
|
|
261
261
|
var selectedAnnotationId = selectedAnnotations && selectedAnnotations.length !== 0 && selectedAnnotations[0].id ? selectedAnnotations[0].id : undefined;
|
|
262
|
+
|
|
262
263
|
// If the new state has an unresolved selected annotation, and it's different from
|
|
263
|
-
// the previous one then
|
|
264
|
+
// the previous one then...
|
|
264
265
|
if (
|
|
265
266
|
//This checks the selected annotation is different from the previous one
|
|
266
267
|
selectedAnnotationId && selectedAnnotationId !== (prevSelectedAnnotations === null || prevSelectedAnnotations === void 0 || (_prevSelectedAnnotati = prevSelectedAnnotations[0]) === null || _prevSelectedAnnotati === void 0 ? void 0 : _prevSelectedAnnotati.id) &&
|
|
267
268
|
// This ensures that the selected annotation is unresolved
|
|
268
269
|
annotations && annotations[selectedAnnotationId] === false) {
|
|
269
270
|
var _options$selectCommen;
|
|
271
|
+
// ...we mark the select annotation experience as complete.
|
|
270
272
|
// The selectComponentExperience is using a simplified object, which is why it's type asserted.
|
|
271
273
|
(_options$selectCommen = options.selectCommentExperience) === null || _options$selectCommen === void 0 || _options$selectCommen.selectAnnotation.complete(selectedAnnotationId);
|
|
274
|
+
if (fg('cc_comments_track_view_inline_comment_action')) {
|
|
275
|
+
var _options$viewInlineCo;
|
|
276
|
+
// ...and start a new UFO press trace since the selected comment is changing
|
|
277
|
+
(_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
|
|
278
|
+
}
|
|
272
279
|
}
|
|
273
280
|
if (annotationManager) {
|
|
274
281
|
// In the Editor, Annotations can be selected in three ways:
|
package/dist/esm/types/index.js
CHANGED
|
@@ -22,9 +22,4 @@ export var AnnotationTestIds = {
|
|
|
22
22
|
floatingToolbarCreateButton: "".concat(prefix, "-toolbar-create-button"),
|
|
23
23
|
componentSave: "".concat(prefix, "-dummy-save-button"),
|
|
24
24
|
componentClose: "".concat(prefix, "-dummy-close-button")
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Alternative to SelectInlineCommentCompoundExperience, used for the annotation plugin options
|
|
29
|
-
* in the confluence editor presets. See createFullPageEditorPreset.ts or annotationPluginOptions.ts for usage.
|
|
30
|
-
*/
|
|
25
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { annotationPlugin } from './annotationPlugin';
|
|
2
2
|
export type { AnnotationPlugin, AnnotationPluginOptions } from './annotationPluginType';
|
|
3
|
-
export type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider,
|
|
3
|
+
export type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentInputMethod, InlineCommentState, InlineCommentViewComponentProps, TargetType, } from './types';
|
|
4
4
|
export type { InlineCommentMap, InlineCommentPluginState, InlineCommentPluginOptions, InlineCommentAction, } from './pm-plugins/types';
|
|
@@ -25,6 +25,7 @@ export interface InlineCommentPluginOptions {
|
|
|
25
25
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
26
26
|
featureFlagsPluginState?: FeatureFlags;
|
|
27
27
|
selectCommentExperience?: AnnotationProviders['selectCommentExperience'];
|
|
28
|
+
viewInlineCommentTraceUFOPress?: AnnotationProviders['viewInlineCommentTraceUFOPress'];
|
|
28
29
|
annotationManager?: AnnotationManager;
|
|
29
30
|
api?: AnnotationPluginInjectionAPI;
|
|
30
31
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
4
3
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { AnnotationUpdateEmitter, AnnotationManager } from '@atlaskit/editor-common/annotation';
|
|
6
5
|
/**
|
|
@@ -111,8 +110,29 @@ export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationT
|
|
|
111
110
|
};
|
|
112
111
|
export interface AnnotationProviders {
|
|
113
112
|
inlineComment: InlineCommentAnnotationProvider;
|
|
114
|
-
createCommentExperience?:
|
|
115
|
-
|
|
113
|
+
createCommentExperience?: {
|
|
114
|
+
start: (_: {
|
|
115
|
+
attributes: {
|
|
116
|
+
pageClass: 'editor';
|
|
117
|
+
commentType: 'inline';
|
|
118
|
+
annotationId?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
pageClass: 'editor';
|
|
121
|
+
commentType: 'block';
|
|
122
|
+
blockType: 'media';
|
|
123
|
+
annotationId?: undefined;
|
|
124
|
+
};
|
|
125
|
+
}) => void;
|
|
126
|
+
initExperience: {
|
|
127
|
+
start: () => void;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
selectCommentExperience?: {
|
|
131
|
+
selectAnnotation: {
|
|
132
|
+
complete: (annotationId: string) => void;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
viewInlineCommentTraceUFOPress?: () => void;
|
|
116
136
|
annotationManager?: AnnotationManager;
|
|
117
137
|
}
|
|
118
138
|
export declare enum AnnotationSelectionType {
|
|
@@ -139,137 +159,4 @@ export type DraftBookmark = {
|
|
|
139
159
|
head: number;
|
|
140
160
|
isBlockNode?: boolean;
|
|
141
161
|
};
|
|
142
|
-
type ExperienceAttributes = {
|
|
143
|
-
[key: string]: string | number | boolean | string[] | number[];
|
|
144
|
-
};
|
|
145
|
-
type InlineCommentAttributes = {
|
|
146
|
-
pageClass: 'editor';
|
|
147
|
-
commentType: 'inline';
|
|
148
|
-
annotationId?: undefined;
|
|
149
|
-
} | {
|
|
150
|
-
pageClass: 'editor';
|
|
151
|
-
commentType: 'block';
|
|
152
|
-
blockType: 'media';
|
|
153
|
-
annotationId?: undefined;
|
|
154
|
-
} | {
|
|
155
|
-
pageClass: 'renderer';
|
|
156
|
-
commentType: 'inline';
|
|
157
|
-
annotationId: string;
|
|
158
|
-
} | {
|
|
159
|
-
pageClass: 'renderer';
|
|
160
|
-
commentType: 'block';
|
|
161
|
-
blockType: 'media';
|
|
162
|
-
annotationId: string;
|
|
163
|
-
};
|
|
164
|
-
export type SelectInlineCommentCompoundExperienceEntryPoint = 'create-comment' | 'annotation-change' | 'comment-navigation' | 'keyboard-navigation' | 'sidebar' | 'unknown:RendererFocus' | 'unknown:InlineComment' | 'unknown:CommentsPanelList';
|
|
165
|
-
export type StartAttributes = {
|
|
166
|
-
pageClass: 'editor' | 'renderer';
|
|
167
|
-
/**
|
|
168
|
-
* This is optional as in some scenarios the entry point does not know
|
|
169
|
-
* what type of comment is being selected (e.g. comment navigation, sidebar).
|
|
170
|
-
**/
|
|
171
|
-
commentType?: 'block' | 'inline';
|
|
172
|
-
blockType?: 'media';
|
|
173
|
-
annotationId: string;
|
|
174
|
-
entryPoint: Exclude<SelectInlineCommentCompoundExperienceEntryPoint, 'keyboard-navigation' | 'comment-navigation'>;
|
|
175
|
-
} | {
|
|
176
|
-
pageClass: 'editor' | 'renderer';
|
|
177
|
-
/**
|
|
178
|
-
* This is optional as in some scenarios the entry point does not know
|
|
179
|
-
* what type of comment is being selected (e.g. comment navigation, sidebar).
|
|
180
|
-
**/
|
|
181
|
-
commentType?: 'block' | 'inline';
|
|
182
|
-
blockType?: 'media';
|
|
183
|
-
entryPoint: 'keyboard-navigation' | 'comment-navigation';
|
|
184
|
-
};
|
|
185
|
-
type ExperienceDebugFunction = (params: {
|
|
186
|
-
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
187
|
-
error: Error;
|
|
188
|
-
extraAttributes?: ExperienceAttributes;
|
|
189
|
-
}) => void;
|
|
190
|
-
export type InlineCommentCompoundExperience = {
|
|
191
|
-
start: (params: {
|
|
192
|
-
attributes: InlineCommentAttributes;
|
|
193
|
-
}) => void;
|
|
194
|
-
debug: ExperienceDebugFunction;
|
|
195
|
-
addCommonAttributes: (commonAttributes: ExperienceAttributes) => void;
|
|
196
|
-
attachCommonAttributes: (experienceName: string) => void;
|
|
197
|
-
initExperience: {
|
|
198
|
-
start: () => void;
|
|
199
|
-
fail: (error: Error) => void;
|
|
200
|
-
softFail: (error: Error) => void;
|
|
201
|
-
abort: (params: {
|
|
202
|
-
abortReason: 'Draft annotation removed from document';
|
|
203
|
-
}) => void;
|
|
204
|
-
complete: () => void;
|
|
205
|
-
debug: ExperienceDebugFunction;
|
|
206
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
207
|
-
};
|
|
208
|
-
draftToPublishExperience: {
|
|
209
|
-
start: () => void;
|
|
210
|
-
publishFailed: (error: Error) => void;
|
|
211
|
-
publishSucceeded: () => void;
|
|
212
|
-
abort: (params: {
|
|
213
|
-
abortReason: 'Create Comment UI dismissed' | 'Unable to apply annotation to document';
|
|
214
|
-
}) => void;
|
|
215
|
-
fail: (error: Error, attributes?: ExperienceAttributes) => void;
|
|
216
|
-
dismissed: () => void;
|
|
217
|
-
softFail: (error: Error) => void;
|
|
218
|
-
complete: () => void;
|
|
219
|
-
debug: ExperienceDebugFunction;
|
|
220
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
221
|
-
};
|
|
222
|
-
attachCommentExperience: {
|
|
223
|
-
start: () => void;
|
|
224
|
-
fail: (error: Error, attributes?: ExperienceAttributes) => void;
|
|
225
|
-
complete: () => void;
|
|
226
|
-
debug: ExperienceDebugFunction;
|
|
227
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
export type SelectAbortReasons = 'test abort' | 'Comment being resolved';
|
|
231
|
-
export type SelectParentAbortReasons = 'Parent experience aborting with reason: test abort' | 'Parent experience aborting with reason: Comment being resolved';
|
|
232
|
-
export type SelectInlineCommentCompoundExperience = {
|
|
233
|
-
_start: (startAttributes: StartAttributes) => void;
|
|
234
|
-
addCommonAttributes: (additionalCommonAttributes: {
|
|
235
|
-
[key: string]: boolean | null | number | string | undefined | Array<number | string>;
|
|
236
|
-
}) => void;
|
|
237
|
-
abort: (params: {
|
|
238
|
-
abortReason: SelectAbortReasons;
|
|
239
|
-
abortSubexperiences?: boolean;
|
|
240
|
-
}) => void;
|
|
241
|
-
selectAnnotation: {
|
|
242
|
-
debug: ExperienceDebugFunction;
|
|
243
|
-
start: (startAttributes: StartAttributes) => void;
|
|
244
|
-
abort: (params: {
|
|
245
|
-
abortReason: 'Comment navigation when only one comment' | 'Navigating to general comment' | SelectParentAbortReasons;
|
|
246
|
-
}) => void;
|
|
247
|
-
complete: (startAttributes: StartAttributes) => void;
|
|
248
|
-
};
|
|
249
|
-
showComment: {
|
|
250
|
-
debug: ExperienceDebugFunction;
|
|
251
|
-
debugPoint: (message: string, attributes?: {
|
|
252
|
-
[key: string]: string | number | boolean;
|
|
253
|
-
}) => void;
|
|
254
|
-
start: (startAttributes: StartAttributes & {
|
|
255
|
-
annotationId: string;
|
|
256
|
-
}) => void;
|
|
257
|
-
abort: (params: {
|
|
258
|
-
abortReason: 'Non inline comment being shown' | 'Comment sidebar dismissed' | 'InlineComment component unmounted' | SelectParentAbortReasons;
|
|
259
|
-
}) => void;
|
|
260
|
-
fail: (error: Error, extraAttributes?: {
|
|
261
|
-
misalignedBy: number;
|
|
262
|
-
}) => void;
|
|
263
|
-
complete: () => void;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Alternative to SelectInlineCommentCompoundExperience, used for the annotation plugin options
|
|
268
|
-
* in the confluence editor presets. See createFullPageEditorPreset.ts or annotationPluginOptions.ts for usage.
|
|
269
|
-
*/
|
|
270
|
-
export type SimpleSelectInlineCommentCompoundExperience = {
|
|
271
|
-
selectAnnotation: {
|
|
272
|
-
complete: (annotationId: string) => void;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
162
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { annotationPlugin } from './annotationPlugin';
|
|
2
2
|
export type { AnnotationPlugin, AnnotationPluginOptions } from './annotationPluginType';
|
|
3
|
-
export type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider,
|
|
3
|
+
export type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentInputMethod, InlineCommentState, InlineCommentViewComponentProps, TargetType, } from './types';
|
|
4
4
|
export type { InlineCommentMap, InlineCommentPluginState, InlineCommentPluginOptions, InlineCommentAction, } from './pm-plugins/types';
|
|
@@ -25,6 +25,7 @@ export interface InlineCommentPluginOptions {
|
|
|
25
25
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
26
26
|
featureFlagsPluginState?: FeatureFlags;
|
|
27
27
|
selectCommentExperience?: AnnotationProviders['selectCommentExperience'];
|
|
28
|
+
viewInlineCommentTraceUFOPress?: AnnotationProviders['viewInlineCommentTraceUFOPress'];
|
|
28
29
|
annotationManager?: AnnotationManager;
|
|
29
30
|
api?: AnnotationPluginInjectionAPI;
|
|
30
31
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
4
3
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { AnnotationUpdateEmitter, AnnotationManager } from '@atlaskit/editor-common/annotation';
|
|
6
5
|
/**
|
|
@@ -111,8 +110,29 @@ export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationT
|
|
|
111
110
|
};
|
|
112
111
|
export interface AnnotationProviders {
|
|
113
112
|
inlineComment: InlineCommentAnnotationProvider;
|
|
114
|
-
createCommentExperience?:
|
|
115
|
-
|
|
113
|
+
createCommentExperience?: {
|
|
114
|
+
start: (_: {
|
|
115
|
+
attributes: {
|
|
116
|
+
pageClass: 'editor';
|
|
117
|
+
commentType: 'inline';
|
|
118
|
+
annotationId?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
pageClass: 'editor';
|
|
121
|
+
commentType: 'block';
|
|
122
|
+
blockType: 'media';
|
|
123
|
+
annotationId?: undefined;
|
|
124
|
+
};
|
|
125
|
+
}) => void;
|
|
126
|
+
initExperience: {
|
|
127
|
+
start: () => void;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
selectCommentExperience?: {
|
|
131
|
+
selectAnnotation: {
|
|
132
|
+
complete: (annotationId: string) => void;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
viewInlineCommentTraceUFOPress?: () => void;
|
|
116
136
|
annotationManager?: AnnotationManager;
|
|
117
137
|
}
|
|
118
138
|
export declare enum AnnotationSelectionType {
|
|
@@ -139,137 +159,4 @@ export type DraftBookmark = {
|
|
|
139
159
|
head: number;
|
|
140
160
|
isBlockNode?: boolean;
|
|
141
161
|
};
|
|
142
|
-
type ExperienceAttributes = {
|
|
143
|
-
[key: string]: string | number | boolean | string[] | number[];
|
|
144
|
-
};
|
|
145
|
-
type InlineCommentAttributes = {
|
|
146
|
-
pageClass: 'editor';
|
|
147
|
-
commentType: 'inline';
|
|
148
|
-
annotationId?: undefined;
|
|
149
|
-
} | {
|
|
150
|
-
pageClass: 'editor';
|
|
151
|
-
commentType: 'block';
|
|
152
|
-
blockType: 'media';
|
|
153
|
-
annotationId?: undefined;
|
|
154
|
-
} | {
|
|
155
|
-
pageClass: 'renderer';
|
|
156
|
-
commentType: 'inline';
|
|
157
|
-
annotationId: string;
|
|
158
|
-
} | {
|
|
159
|
-
pageClass: 'renderer';
|
|
160
|
-
commentType: 'block';
|
|
161
|
-
blockType: 'media';
|
|
162
|
-
annotationId: string;
|
|
163
|
-
};
|
|
164
|
-
export type SelectInlineCommentCompoundExperienceEntryPoint = 'create-comment' | 'annotation-change' | 'comment-navigation' | 'keyboard-navigation' | 'sidebar' | 'unknown:RendererFocus' | 'unknown:InlineComment' | 'unknown:CommentsPanelList';
|
|
165
|
-
export type StartAttributes = {
|
|
166
|
-
pageClass: 'editor' | 'renderer';
|
|
167
|
-
/**
|
|
168
|
-
* This is optional as in some scenarios the entry point does not know
|
|
169
|
-
* what type of comment is being selected (e.g. comment navigation, sidebar).
|
|
170
|
-
**/
|
|
171
|
-
commentType?: 'block' | 'inline';
|
|
172
|
-
blockType?: 'media';
|
|
173
|
-
annotationId: string;
|
|
174
|
-
entryPoint: Exclude<SelectInlineCommentCompoundExperienceEntryPoint, 'keyboard-navigation' | 'comment-navigation'>;
|
|
175
|
-
} | {
|
|
176
|
-
pageClass: 'editor' | 'renderer';
|
|
177
|
-
/**
|
|
178
|
-
* This is optional as in some scenarios the entry point does not know
|
|
179
|
-
* what type of comment is being selected (e.g. comment navigation, sidebar).
|
|
180
|
-
**/
|
|
181
|
-
commentType?: 'block' | 'inline';
|
|
182
|
-
blockType?: 'media';
|
|
183
|
-
entryPoint: 'keyboard-navigation' | 'comment-navigation';
|
|
184
|
-
};
|
|
185
|
-
type ExperienceDebugFunction = (params: {
|
|
186
|
-
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
187
|
-
error: Error;
|
|
188
|
-
extraAttributes?: ExperienceAttributes;
|
|
189
|
-
}) => void;
|
|
190
|
-
export type InlineCommentCompoundExperience = {
|
|
191
|
-
start: (params: {
|
|
192
|
-
attributes: InlineCommentAttributes;
|
|
193
|
-
}) => void;
|
|
194
|
-
debug: ExperienceDebugFunction;
|
|
195
|
-
addCommonAttributes: (commonAttributes: ExperienceAttributes) => void;
|
|
196
|
-
attachCommonAttributes: (experienceName: string) => void;
|
|
197
|
-
initExperience: {
|
|
198
|
-
start: () => void;
|
|
199
|
-
fail: (error: Error) => void;
|
|
200
|
-
softFail: (error: Error) => void;
|
|
201
|
-
abort: (params: {
|
|
202
|
-
abortReason: 'Draft annotation removed from document';
|
|
203
|
-
}) => void;
|
|
204
|
-
complete: () => void;
|
|
205
|
-
debug: ExperienceDebugFunction;
|
|
206
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
207
|
-
};
|
|
208
|
-
draftToPublishExperience: {
|
|
209
|
-
start: () => void;
|
|
210
|
-
publishFailed: (error: Error) => void;
|
|
211
|
-
publishSucceeded: () => void;
|
|
212
|
-
abort: (params: {
|
|
213
|
-
abortReason: 'Create Comment UI dismissed' | 'Unable to apply annotation to document';
|
|
214
|
-
}) => void;
|
|
215
|
-
fail: (error: Error, attributes?: ExperienceAttributes) => void;
|
|
216
|
-
dismissed: () => void;
|
|
217
|
-
softFail: (error: Error) => void;
|
|
218
|
-
complete: () => void;
|
|
219
|
-
debug: ExperienceDebugFunction;
|
|
220
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
221
|
-
};
|
|
222
|
-
attachCommentExperience: {
|
|
223
|
-
start: () => void;
|
|
224
|
-
fail: (error: Error, attributes?: ExperienceAttributes) => void;
|
|
225
|
-
complete: () => void;
|
|
226
|
-
debug: ExperienceDebugFunction;
|
|
227
|
-
debugPoint: (message: string, attributes?: ExperienceAttributes) => void;
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
export type SelectAbortReasons = 'test abort' | 'Comment being resolved';
|
|
231
|
-
export type SelectParentAbortReasons = 'Parent experience aborting with reason: test abort' | 'Parent experience aborting with reason: Comment being resolved';
|
|
232
|
-
export type SelectInlineCommentCompoundExperience = {
|
|
233
|
-
_start: (startAttributes: StartAttributes) => void;
|
|
234
|
-
addCommonAttributes: (additionalCommonAttributes: {
|
|
235
|
-
[key: string]: boolean | null | number | string | undefined | Array<number | string>;
|
|
236
|
-
}) => void;
|
|
237
|
-
abort: (params: {
|
|
238
|
-
abortReason: SelectAbortReasons;
|
|
239
|
-
abortSubexperiences?: boolean;
|
|
240
|
-
}) => void;
|
|
241
|
-
selectAnnotation: {
|
|
242
|
-
debug: ExperienceDebugFunction;
|
|
243
|
-
start: (startAttributes: StartAttributes) => void;
|
|
244
|
-
abort: (params: {
|
|
245
|
-
abortReason: 'Comment navigation when only one comment' | 'Navigating to general comment' | SelectParentAbortReasons;
|
|
246
|
-
}) => void;
|
|
247
|
-
complete: (startAttributes: StartAttributes) => void;
|
|
248
|
-
};
|
|
249
|
-
showComment: {
|
|
250
|
-
debug: ExperienceDebugFunction;
|
|
251
|
-
debugPoint: (message: string, attributes?: {
|
|
252
|
-
[key: string]: string | number | boolean;
|
|
253
|
-
}) => void;
|
|
254
|
-
start: (startAttributes: StartAttributes & {
|
|
255
|
-
annotationId: string;
|
|
256
|
-
}) => void;
|
|
257
|
-
abort: (params: {
|
|
258
|
-
abortReason: 'Non inline comment being shown' | 'Comment sidebar dismissed' | 'InlineComment component unmounted' | SelectParentAbortReasons;
|
|
259
|
-
}) => void;
|
|
260
|
-
fail: (error: Error, extraAttributes?: {
|
|
261
|
-
misalignedBy: number;
|
|
262
|
-
}) => void;
|
|
263
|
-
complete: () => void;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Alternative to SelectInlineCommentCompoundExperience, used for the annotation plugin options
|
|
268
|
-
* in the confluence editor presets. See createFullPageEditorPreset.ts or annotationPluginOptions.ts for usage.
|
|
269
|
-
*/
|
|
270
|
-
export type SimpleSelectInlineCommentCompoundExperience = {
|
|
271
|
-
selectAnnotation: {
|
|
272
|
-
complete: (annotationId: string) => void;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
162
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
-
"@atlaskit/analytics-next": "^11.
|
|
35
|
+
"@atlaskit/analytics-next": "^11.1.0",
|
|
36
36
|
"@atlaskit/editor-common": "^106.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/icon": "^26.4.0",
|
|
43
43
|
"@atlaskit/onboarding": "^14.2.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^5.8.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -115,6 +115,9 @@
|
|
|
115
115
|
"platform_editor_listen_for_focussed_query_param": {
|
|
116
116
|
"type": "boolean"
|
|
117
117
|
},
|
|
118
|
+
"cc_comments_track_view_inline_comment_action": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
118
121
|
"confluence_frontend_handle_annotation_error": {
|
|
119
122
|
"type": "boolean"
|
|
120
123
|
},
|