@atlaskit/editor-plugin-annotation 10.3.2 → 10.3.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 10.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 10.3.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`834849ffe657a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/834849ffe657a) -
14
+ Move markdown mode to use mdast-util-from-pm and add annotation support
15
+
3
16
  ## 10.3.2
4
17
 
5
18
  ### Patch Changes
@@ -42,7 +42,9 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
42
42
  hasAnyUnResolvedAnnotationInPage: _utils.hasAnyUnResolvedAnnotationInPage,
43
43
  stripNonExistingAnnotations: _utils.stripNonExistingAnnotations,
44
44
  setInlineCommentDraftState: (0, _editorCommands.setInlineCommentDraftState)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
45
- showCommentForBlockNode: (0, _editorCommands.showInlineCommentForBlockNode)(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes)
45
+ showCommentForBlockNode: (0, _editorCommands.showInlineCommentForBlockNode)(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
46
+ setSelectedAnnotation: _editorCommands.setSelectedAnnotation,
47
+ setPendingSelectedAnnotation: _editorCommands.setPendingSelectedAnnotation
46
48
  },
47
49
  getSharedState: function getSharedState(editorState) {
48
50
  if (!editorState) {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { isSSR } from '@atlaskit/editor-common/core-utils';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
- import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
5
+ import { setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
6
6
  import { annotationWithToDOMFix } from './nodeviews/annotationMark';
7
7
  import { inlineCommentPlugin } from './pm-plugins/inline-comment';
8
8
  import { keymapPlugin } from './pm-plugins/keymap';
@@ -33,7 +33,9 @@ export const annotationPlugin = ({
33
33
  hasAnyUnResolvedAnnotationInPage,
34
34
  stripNonExistingAnnotations,
35
35
  setInlineCommentDraftState: setInlineCommentDraftState(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
36
- showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes)
36
+ showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
37
+ setSelectedAnnotation,
38
+ setPendingSelectedAnnotation
37
39
  },
38
40
  getSharedState(editorState) {
39
41
  if (!editorState) {
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import { isSSR } from '@atlaskit/editor-common/core-utils';
6
6
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
7
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
- import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
8
+ import { setInlineCommentDraftState, setSelectedAnnotation, setPendingSelectedAnnotation, showInlineCommentForBlockNode } from './editor-commands';
9
9
  import { annotationWithToDOMFix } from './nodeviews/annotationMark';
10
10
  import { inlineCommentPlugin } from './pm-plugins/inline-comment';
11
11
  import { keymapPlugin } from './pm-plugins/keymap';
@@ -35,7 +35,9 @@ export var annotationPlugin = function annotationPlugin(_ref) {
35
35
  hasAnyUnResolvedAnnotationInPage: hasAnyUnResolvedAnnotationInPage,
36
36
  stripNonExistingAnnotations: stripNonExistingAnnotations,
37
37
  setInlineCommentDraftState: setInlineCommentDraftState(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
38
- showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes)
38
+ showCommentForBlockNode: showInlineCommentForBlockNode(annotationProviders === null || annotationProviders === void 0 ? void 0 : annotationProviders.inlineComment.supportedBlockNodes),
39
+ setSelectedAnnotation: setSelectedAnnotation,
40
+ setPendingSelectedAnnotation: setPendingSelectedAnnotation
39
41
  },
40
42
  getSharedState: function getSharedState(editorState) {
41
43
  if (!editorState) {
@@ -29,6 +29,18 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
29
29
  actions: {
30
30
  hasAnyUnResolvedAnnotationInPage: (state: EditorState) => boolean;
31
31
  setInlineCommentDraftState: SetInlineCommentDraftState;
32
+ /**
33
+ * Sets a pending selected annotation, opening its comment popup or panel.
34
+ * Equivalent to clicking the annotation mark in the WYSIWYG view.
35
+ * Use when the annotation manager (comments panel) IS enabled.
36
+ */
37
+ setPendingSelectedAnnotation: (annotationId: string) => Command;
38
+ /**
39
+ * Selects the given annotation, opening its comment popup or panel.
40
+ * Equivalent to clicking the annotation mark in the WYSIWYG view.
41
+ * Use when the annotation manager (comments panel) is NOT enabled.
42
+ */
43
+ setSelectedAnnotation: (annotationId: string) => Command;
32
44
  /**
33
45
  * This function attempts to display the inline comment popup for a given node.
34
46
  * @returns A command function that returns true if the given node is supported and has resolved annotation mark(s);
@@ -29,6 +29,18 @@ export type AnnotationPlugin = NextEditorPlugin<'annotation', {
29
29
  actions: {
30
30
  hasAnyUnResolvedAnnotationInPage: (state: EditorState) => boolean;
31
31
  setInlineCommentDraftState: SetInlineCommentDraftState;
32
+ /**
33
+ * Sets a pending selected annotation, opening its comment popup or panel.
34
+ * Equivalent to clicking the annotation mark in the WYSIWYG view.
35
+ * Use when the annotation manager (comments panel) IS enabled.
36
+ */
37
+ setPendingSelectedAnnotation: (annotationId: string) => Command;
38
+ /**
39
+ * Selects the given annotation, opening its comment popup or panel.
40
+ * Equivalent to clicking the annotation mark in the WYSIWYG view.
41
+ * Use when the annotation manager (comments panel) is NOT enabled.
42
+ */
43
+ setSelectedAnnotation: (annotationId: string) => Command;
32
44
  /**
33
45
  * This function attempts to display the inline comment popup for a given node.
34
46
  * @returns A command function that returns true if the given node is supported and has resolved annotation mark(s);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "10.3.2",
3
+ "version": "10.3.4",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,16 +30,16 @@
30
30
  "@atlaskit/adf-schema": "^52.11.0",
31
31
  "@atlaskit/editor-plugin-analytics": "^10.0.0",
32
32
  "@atlaskit/editor-plugin-connectivity": "^10.0.0",
33
- "@atlaskit/editor-plugin-editor-viewmode-effects": "^10.0.0",
34
- "@atlaskit/editor-plugin-feature-flags": "^9.0.0",
35
- "@atlaskit/editor-plugin-toolbar": "^7.2.0",
36
- "@atlaskit/editor-plugin-user-intent": "^8.1.0",
33
+ "@atlaskit/editor-plugin-editor-viewmode-effects": "^10.1.0",
34
+ "@atlaskit/editor-plugin-feature-flags": "^9.1.0",
35
+ "@atlaskit/editor-plugin-toolbar": "^7.3.0",
36
+ "@atlaskit/editor-plugin-user-intent": "^8.2.0",
37
37
  "@atlaskit/editor-prosemirror": "^7.3.0",
38
- "@atlaskit/editor-toolbar": "^1.2.0",
39
- "@atlaskit/editor-toolbar-model": "^0.4.0",
38
+ "@atlaskit/editor-toolbar": "^1.4.0",
39
+ "@atlaskit/editor-toolbar-model": "^0.5.0",
40
40
  "@atlaskit/icon": "^34.5.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
- "@atlaskit/tmp-editor-statsig": "^80.0.0",
42
+ "@atlaskit/tmp-editor-statsig": "^80.2.0",
43
43
  "@babel/runtime": "^7.0.0"
44
44
  },
45
45
  "peerDependencies": {