@atlaskit/editor-plugin-annotation 19.1.0 → 19.2.1
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 +18 -0
- package/dist/cjs/annotationPlugin.js +2 -2
- package/dist/cjs/editor-commands/index.js +22 -14
- package/dist/cjs/editor-commands/transform.js +4 -4
- package/dist/cjs/pm-plugins/annotation-manager-hooks.js +5 -5
- package/dist/cjs/pm-plugins/inline-comment.js +2 -3
- package/dist/cjs/pm-plugins/reducer.js +3 -3
- package/dist/cjs/pm-plugins/utils.js +10 -5
- package/dist/cjs/ui/InlineCommentView.js +3 -3
- package/dist/es2019/annotationPlugin.js +2 -2
- package/dist/es2019/editor-commands/index.js +20 -18
- package/dist/es2019/editor-commands/transform.js +4 -4
- package/dist/es2019/pm-plugins/annotation-manager-hooks.js +5 -5
- package/dist/es2019/pm-plugins/inline-comment.js +3 -4
- package/dist/es2019/pm-plugins/reducer.js +3 -3
- package/dist/es2019/pm-plugins/utils.js +9 -7
- package/dist/es2019/ui/InlineCommentView.js +3 -3
- package/dist/esm/annotationPlugin.js +2 -2
- package/dist/esm/editor-commands/index.js +22 -14
- package/dist/esm/editor-commands/transform.js +4 -4
- package/dist/esm/pm-plugins/annotation-manager-hooks.js +5 -5
- package/dist/esm/pm-plugins/inline-comment.js +3 -4
- package/dist/esm/pm-plugins/reducer.js +3 -3
- package/dist/esm/pm-plugins/utils.js +10 -5
- package/dist/esm/ui/InlineCommentView.js +3 -3
- package/dist/types/editor-commands/index.d.ts +7 -7
- package/dist/types/editor-commands/transform.d.ts +3 -3
- package/dist/types/pm-plugins/annotation-manager-hooks.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -0
- package/dist/types/pm-plugins/utils.d.ts +4 -4
- package/dist/types/types/index.d.ts +9 -0
- package/package.json +7 -3
|
@@ -3,7 +3,7 @@ import type { Mark, Node, ResolvedPos, Schema, Slice } from '@atlaskit/editor-pr
|
|
|
3
3
|
import type { EditorState, Selection, SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { AnnotationInfo, DraftBookmark, InlineCommentInputMethod, TargetType } from '../types';
|
|
6
|
+
import type { AnnotationInfo, DraftBookmark, InlineCommentAnnotationProvider, InlineCommentInputMethod, TargetType } from '../types';
|
|
7
7
|
import { AnnotationSelectionType } from '../types';
|
|
8
8
|
import type { InlineCommentPluginState } from './types';
|
|
9
9
|
/**
|
|
@@ -19,7 +19,7 @@ export declare const decorationKey: {
|
|
|
19
19
|
export declare const addDraftDecoration: (start: number, end: number, targetType?: TargetType) => Decoration;
|
|
20
20
|
export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
|
|
21
21
|
export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
|
|
22
|
-
export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[]) => DraftBookmark;
|
|
22
|
+
export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[], isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => DraftBookmark;
|
|
23
23
|
/**
|
|
24
24
|
* get selection from position to apply new comment for
|
|
25
25
|
* @returns bookmarked positions if they exists, otherwise current selection positions
|
|
@@ -31,9 +31,9 @@ export declare const getPluginState: (state: EditorState) => InlineCommentPlugin
|
|
|
31
31
|
* get payload for the open/close analytics event
|
|
32
32
|
*/
|
|
33
33
|
export declare const getDraftCommandAnalyticsPayload: (drafting: boolean, inputMethod: InlineCommentInputMethod) => AnalyticsEventPayloadCallback;
|
|
34
|
-
export declare const isSelectionValid: (state: EditorState,
|
|
34
|
+
export declare const isSelectionValid: (state: EditorState, supportedBlockNodes?: string[], isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => AnnotationSelectionType;
|
|
35
35
|
export declare const hasInvalidNodes: (state: EditorState) => boolean;
|
|
36
|
-
export declare const isSupportedBlockNode: (node: Node, supportedBlockNodes?: string[]) => boolean;
|
|
36
|
+
export declare const isSupportedBlockNode: (node: Node, supportedBlockNodes?: string[], isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => boolean;
|
|
37
37
|
/**
|
|
38
38
|
* Checks if any of the nodes in a given selection are completely whitespace
|
|
39
39
|
* This is to conform to Confluence annotation specifications
|
|
@@ -2,6 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import type { AnnotationTypes } from '@atlaskit/adf-schema/annotation';
|
|
3
3
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { AnnotationUpdateEmitter, AnnotationManager } from '@atlaskit/editor-common/annotation';
|
|
5
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
/**
|
|
6
7
|
* type of target that annotation apply to.
|
|
7
8
|
* This is used to apply correct decoration to a draft comment
|
|
@@ -99,6 +100,14 @@ export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationT
|
|
|
99
100
|
contentType?: string;
|
|
100
101
|
createComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentCreateComponentProps>>;
|
|
101
102
|
getCanAddComments?: () => boolean;
|
|
103
|
+
/**
|
|
104
|
+
* @experimental Still under development. Do not use.
|
|
105
|
+
*
|
|
106
|
+
* Determines whether a specific block node supports inline comments.
|
|
107
|
+
* This is additive to `supportedBlockNodes`; a node is supported when either configuration
|
|
108
|
+
* matches it.
|
|
109
|
+
*/
|
|
110
|
+
isBlockNodeSupported?: (node: PMNode) => boolean;
|
|
102
111
|
isToolbarAbove?: boolean;
|
|
103
112
|
onCommentButtonMount?: () => void;
|
|
104
113
|
/** Checks whether the active inline comment can be safely closed. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "19.1
|
|
3
|
+
"version": "19.2.1",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
32
32
|
"@atlaskit/icon": "^37.7.0",
|
|
33
33
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^203.0.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@atlaskit/editor-common": "^123.
|
|
38
|
+
"@atlaskit/editor-common": "^123.8.0",
|
|
39
39
|
"react": "^18.2.0 || ^19.2.0",
|
|
40
40
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
41
41
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"wait-for-expect": "^1.2.0"
|
|
49
49
|
},
|
|
50
50
|
"platform-feature-flags": {
|
|
51
|
+
"cc_maui_annotations_on_extensions": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"referenceOnly": true
|
|
54
|
+
},
|
|
51
55
|
"platform_editor_comments_api_manager": {
|
|
52
56
|
"type": "boolean",
|
|
53
57
|
"referenceOnly": true
|