@atlaskit/editor-plugin-annotation 27.0.6 → 28.1.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.
@@ -1,3 +1,4 @@
1
+ import type { AnnotationManager } from '@atlaskit/editor-common/annotation';
1
2
  import type { Command } from '@atlaskit/editor-common/types/command';
2
3
  import type { ExtractInjectionAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
3
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
@@ -26,6 +27,10 @@ export type AnnotationPluginDependencies = [
26
27
  OptionalPlugin<UserIntentPlugin>
27
28
  ];
28
29
  export type AnnotationPluginOptions = AnnotationProviders;
30
+ /** Inline comment plugin state, plus the manager so other plugins (e.g. media) can use it. */
31
+ export type AnnotationSharedState = InlineCommentPluginState & {
32
+ annotationManager?: AnnotationManager;
33
+ };
29
34
  export type AnnotationPlugin = NextEditorPlugin<'annotation', {
30
35
  actions: {
31
36
  /**
@@ -35,6 +40,15 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
35
40
  * @returns A command that returns true when the draft is applied.
36
41
  */
37
42
  applyInlineCommentDraft: (annotationId: string) => Command;
43
+ /**
44
+ * Whether the current user can add comments, from the provider's
45
+ * `getCanAddComments` (defaults to true), and the provider's content type
46
+ * for the no-permission message.
47
+ */
48
+ getAddCommentPermission: () => {
49
+ canAddComments: boolean;
50
+ contentType?: string;
51
+ };
38
52
  hasAnyUnResolvedAnnotationInPage: (state: EditorState) => boolean;
39
53
  /** Whether the configured provider supports block comments on this node. */
40
54
  isBlockNodeSupported: (node: Node) => boolean;
@@ -73,7 +87,7 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
73
87
  };
74
88
  dependencies: AnnotationPluginDependencies;
75
89
  pluginConfiguration: AnnotationPluginOptions | undefined;
76
- sharedState: InlineCommentPluginState | undefined;
90
+ sharedState: AnnotationSharedState | undefined;
77
91
  }>;
78
92
  export type AnnotationPluginInjectionAPI = ExtractInjectionAPI<AnnotationPlugin> | undefined;
79
93
  export {};
@@ -6,7 +6,7 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-edi
6
6
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { AnnotationPlugin } from '../annotationPluginType';
8
8
  import type { InlineCommentMap, InlineCommentMouseData } from '../pm-plugins/types';
9
- import type { InlineCommentAnnotationProvider, InlineCommentInputMethod, TargetType } from '../types';
9
+ import type { AnnotationProviders, InlineCommentAnnotationProvider, InlineCommentInputMethod, TargetType } from '../types';
10
10
  export declare const updateInlineCommentResolvedState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (partialNewState: InlineCommentMap, resolveMethod?: RESOLVE_METHOD) => Command;
11
11
  export declare const closeComponent: () => Command;
12
12
  export declare const clearDirtyMark: () => Command;
@@ -22,7 +22,7 @@ export declare const removeInlineCommentFromDoc: (editorAnalyticsAPI: EditorAnal
22
22
  * @example
23
23
  */
24
24
  export declare const showInlineCommentForBlockNode: (supportedBlockNodes?: string[], isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => (node: PMNode | null, viewMethod?: VIEW_METHOD, isOpeningMediaCommentFromToolbar?: boolean) => Command;
25
- export declare const setInlineCommentDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, supportedBlockNodes?: string[], api?: ExtractInjectionAPI<AnnotationPlugin>, isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => (drafting: boolean, inputMethod?: InlineCommentInputMethod, targetType?: TargetType, targetNodeId?: string | undefined, isOpeningMediaCommentFromToolbar?: boolean) => Command;
25
+ export declare const setInlineCommentDraftState: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, supportedBlockNodes?: string[], api?: ExtractInjectionAPI<AnnotationPlugin>, isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported'], createCommentExperience?: AnnotationProviders['createCommentExperience']) => (drafting: boolean, inputMethod?: InlineCommentInputMethod, targetType?: TargetType, targetNodeId?: string | undefined, isOpeningMediaCommentFromToolbar?: boolean) => Command;
26
26
  export declare const addInlineComment: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorAPI?: ExtractInjectionAPI<AnnotationPlugin> | undefined) => (id: string, supportedBlockNodes?: string[], isBlockNodeSupported?: InlineCommentAnnotationProvider['isBlockNodeSupported']) => Command;
27
27
  export declare const updateMouseState: (mouseData: InlineCommentMouseData) => Command;
28
28
  export declare const setSelectedAnnotation: (id: string) => Command;
@@ -3,7 +3,7 @@ import type { ApplyDraftResult, ClearAnnotationResult, ClearDraftResult, GetDraf
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { InlineCommentPluginOptions } from './types';
5
5
  export declare const allowAnnotation: (editorView: EditorView, options: InlineCommentPluginOptions) => () => boolean;
6
- export declare const startDraft: (editorView: EditorView, options: InlineCommentPluginOptions) => () => StartDraftResult;
6
+ export declare const startDraft: (editorView: EditorView, options: InlineCommentPluginOptions) => (localId?: string) => StartDraftResult;
7
7
  export declare const clearDraft: (editorView: EditorView, options: InlineCommentPluginOptions) => () => ClearDraftResult;
8
8
  export declare const applyDraft: (editorView: EditorView, options: InlineCommentPluginOptions) => (id: AnnotationId) => ApplyDraftResult;
9
9
  export declare const getDraft: (editorView: EditorView, _options: InlineCommentPluginOptions) => () => GetDraftResult;
@@ -138,7 +138,8 @@ export interface AnnotationProviders {
138
138
  pageClass: 'editor';
139
139
  } | {
140
140
  annotationId?: undefined;
141
- blockType: 'media';
141
+ blockType: 'media' | 'extension';
142
+ commentTargetType?: 'remixEmbed';
142
143
  commentType: 'block';
143
144
  entryPoint?: 'highlightActions';
144
145
  pageClass: 'editor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "27.0.6",
3
+ "version": "28.1.0",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -20,12 +20,12 @@
20
20
  "atlaskit:src": "src/index.ts",
21
21
  "dependencies": {
22
22
  "@atlaskit/adf-schema": "^57.7.0",
23
- "@atlaskit/editor-plugin-analytics": "^27.0.0",
24
- "@atlaskit/editor-plugin-connectivity": "^27.0.0",
25
- "@atlaskit/editor-plugin-editor-viewmode-effects": "^27.0.0",
26
- "@atlaskit/editor-plugin-feature-flags": "^26.0.0",
27
- "@atlaskit/editor-plugin-toolbar": "^24.0.0",
28
- "@atlaskit/editor-plugin-user-intent": "^25.0.0",
23
+ "@atlaskit/editor-plugin-analytics": "^28.0.0",
24
+ "@atlaskit/editor-plugin-connectivity": "^28.0.0",
25
+ "@atlaskit/editor-plugin-editor-viewmode-effects": "^28.0.0",
26
+ "@atlaskit/editor-plugin-feature-flags": "^27.0.0",
27
+ "@atlaskit/editor-plugin-toolbar": "^25.0.0",
28
+ "@atlaskit/editor-plugin-user-intent": "^26.0.0",
29
29
  "@atlaskit/editor-prosemirror": "^9.0.0",
30
30
  "@atlaskit/editor-toolbar": "^2.8.0",
31
31
  "@atlaskit/editor-toolbar-model": "^1.2.0",
@@ -35,7 +35,7 @@
35
35
  "@babel/runtime": "^7.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^131.4.0",
38
+ "@atlaskit/editor-common": "^132.0.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"