@atlaskit/editor-plugin-annotation 3.3.7 → 3.3.9

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,24 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 3.3.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.3.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`286abb4d35eba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/286abb4d35eba) -
14
+ [ux] [ED-28960] Finish full page primary toolbar migration
15
+
16
+ - Align with design update (separator, gap, height, icon size)
17
+ - Add keyboard shortcut to focus toolbar and arrow key navigation
18
+ - Address accessibility
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 3.3.7
4
23
 
5
24
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.shouldSuppressFloatingToolbar = exports.getValidNodes = exports.buildToolbar = exports.buildSuppressedToolbar = void 0;
7
+ exports.shouldSuppressFloatingToolbar = exports.buildToolbar = exports.buildSuppressedToolbar = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
@@ -19,7 +19,7 @@ var _types = require("../types");
19
19
  var _utils2 = require("./utils");
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
- var getValidNodes = exports.getValidNodes = function getValidNodes(state) {
22
+ var getValidNodes = function getValidNodes(state) {
23
23
  var schema = state.schema;
24
24
  var annotation = schema.marks.annotation;
25
25
  return Object.keys(schema.nodes).reduce(function (acc, current) {
@@ -10,7 +10,7 @@ exports.getPluginState = exports.getDraftCommandAnalyticsPayload = exports.getAn
10
10
  exports.getSelectionPositions = getSelectionPositions;
11
11
  exports.hasInvalidNodes = exports.hasAnyUnResolvedAnnotationInPage = void 0;
12
12
  exports.hasInvalidWhitespaceNode = hasInvalidWhitespaceNode;
13
- exports.isCurrentBlockNodeSelected = exports.isBlockNodeAnnotationsSelected = exports.inlineCommentPluginKey = void 0;
13
+ exports.isBlockNodeAnnotationsSelected = exports.inlineCommentPluginKey = void 0;
14
14
  exports.isSelectedAnnotationsChanged = isSelectedAnnotationsChanged;
15
15
  exports.resolveDraftBookmark = exports.isSupportedBlockNode = exports.isSelectionValid = void 0;
16
16
  exports.stripNonExistingAnnotations = stripNonExistingAnnotations;
@@ -145,18 +145,6 @@ var getAnnotationViewKey = exports.getAnnotationViewKey = function getAnnotation
145
145
  }).join('_');
146
146
  return "view-annotation-wrapper_".concat(keys);
147
147
  };
148
- var isCurrentBlockNodeSelected = exports.isCurrentBlockNodeSelected = function isCurrentBlockNodeSelected(state, node) {
149
- var selection = state.selection;
150
- if (selection instanceof _state.NodeSelection) {
151
- if (selection.node === node) {
152
- return true;
153
- }
154
- if (node.type.name === 'media' && selection.node.firstChild === node) {
155
- return true;
156
- }
157
- }
158
- return false;
159
- };
160
148
  var findAnnotationsInSelection = exports.findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc) {
161
149
  var empty = selection.empty,
162
150
  $anchor = selection.$anchor,
@@ -73,7 +73,8 @@ var CommentButton = exports.CommentButton = function CommentButton(_ref) {
73
73
  })
74
74
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButton, {
75
75
  iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.CommentIcon, {
76
- label: ""
76
+ label: "",
77
+ size: "small"
77
78
  }),
78
79
  onClick: onClick,
79
80
  testId: _types.AnnotationTestIds.floatingToolbarCreateButton,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.startCommentExperience = exports.shouldShowCommentButton = exports.isButtonDisabled = exports.fireOnClickAnalyticsEvent = exports.fireCommentButtonViewedAnalyticsEvent = exports.fireAnnotationErrorAnalyticsEvent = void 0;
6
+ exports.startCommentExperience = exports.shouldShowCommentButton = exports.isButtonDisabled = exports.fireOnClickAnalyticsEvent = exports.fireCommentButtonViewedAnalyticsEvent = void 0;
7
7
  var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _mediaSingle = require("@atlaskit/editor-common/media-single");
9
9
  var _editorCommands = require("../../editor-commands");
@@ -42,7 +42,7 @@ var fireOnClickAnalyticsEvent = exports.fireOnClickAnalyticsEvent = function fir
42
42
  }
43
43
  });
44
44
  };
45
- var fireAnnotationErrorAnalyticsEvent = exports.fireAnnotationErrorAnalyticsEvent = function fireAnnotationErrorAnalyticsEvent(_ref4) {
45
+ var fireAnnotationErrorAnalyticsEvent = function fireAnnotationErrorAnalyticsEvent(_ref4) {
46
46
  var _api$analytics2;
47
47
  var api = _ref4.api,
48
48
  errorReason = _ref4.errorReason;
@@ -9,7 +9,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { setInlineCommentDraftState } from '../editor-commands';
10
10
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
11
11
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
12
- export const getValidNodes = state => {
12
+ const getValidNodes = state => {
13
13
  const {
14
14
  schema
15
15
  } = state;
@@ -113,20 +113,6 @@ export const getAnnotationViewKey = annotations => {
113
113
  const keys = annotations.map(mark => mark.id).join('_');
114
114
  return `view-annotation-wrapper_${keys}`;
115
115
  };
116
- export const isCurrentBlockNodeSelected = (state, node) => {
117
- const {
118
- selection
119
- } = state;
120
- if (selection instanceof NodeSelection) {
121
- if (selection.node === node) {
122
- return true;
123
- }
124
- if (node.type.name === 'media' && selection.node.firstChild === node) {
125
- return true;
126
- }
127
- }
128
- return false;
129
- };
130
116
  export const findAnnotationsInSelection = (selection, doc) => {
131
117
  const {
132
118
  empty,
@@ -69,7 +69,8 @@ export const CommentButton = ({
69
69
  })
70
70
  }, /*#__PURE__*/React.createElement(ToolbarButton, {
71
71
  iconBefore: /*#__PURE__*/React.createElement(NewCommentIcon, {
72
- label: ""
72
+ label: "",
73
+ size: "small"
73
74
  }),
74
75
  onClick: onClick,
75
76
  testId: AnnotationTestIds.floatingToolbarCreateButton,
@@ -39,7 +39,7 @@ export const fireOnClickAnalyticsEvent = ({
39
39
  }
40
40
  });
41
41
  };
42
- export const fireAnnotationErrorAnalyticsEvent = ({
42
+ const fireAnnotationErrorAnalyticsEvent = ({
43
43
  api,
44
44
  errorReason
45
45
  }) => {
@@ -12,7 +12,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { setInlineCommentDraftState } from '../editor-commands';
13
13
  import { AnnotationSelectionType, AnnotationTestIds } from '../types';
14
14
  import { getPluginState, isSelectionValid, resolveDraftBookmark } from './utils';
15
- export var getValidNodes = function getValidNodes(state) {
15
+ var getValidNodes = function getValidNodes(state) {
16
16
  var schema = state.schema;
17
17
  var annotation = schema.marks.annotation;
18
18
  return Object.keys(schema.nodes).reduce(function (acc, current) {
@@ -128,18 +128,6 @@ export var getAnnotationViewKey = function getAnnotationViewKey(annotations) {
128
128
  }).join('_');
129
129
  return "view-annotation-wrapper_".concat(keys);
130
130
  };
131
- export var isCurrentBlockNodeSelected = function isCurrentBlockNodeSelected(state, node) {
132
- var selection = state.selection;
133
- if (selection instanceof NodeSelection) {
134
- if (selection.node === node) {
135
- return true;
136
- }
137
- if (node.type.name === 'media' && selection.node.firstChild === node) {
138
- return true;
139
- }
140
- }
141
- return false;
142
- };
143
131
  export var findAnnotationsInSelection = function findAnnotationsInSelection(selection, doc) {
144
132
  var empty = selection.empty,
145
133
  $anchor = selection.$anchor,
@@ -66,7 +66,8 @@ export var CommentButton = function CommentButton(_ref) {
66
66
  })
67
67
  }, /*#__PURE__*/React.createElement(ToolbarButton, {
68
68
  iconBefore: /*#__PURE__*/React.createElement(NewCommentIcon, {
69
- label: ""
69
+ label: "",
70
+ size: "small"
70
71
  }),
71
72
  onClick: onClick,
72
73
  testId: AnnotationTestIds.floatingToolbarCreateButton,
@@ -36,7 +36,7 @@ export var fireOnClickAnalyticsEvent = function fireOnClickAnalyticsEvent(_ref3)
36
36
  }
37
37
  });
38
38
  };
39
- export var fireAnnotationErrorAnalyticsEvent = function fireAnnotationErrorAnalyticsEvent(_ref4) {
39
+ var fireAnnotationErrorAnalyticsEvent = function fireAnnotationErrorAnalyticsEvent(_ref4) {
40
40
  var _api$analytics2;
41
41
  var api = _ref4.api,
42
42
  errorReason = _ref4.errorReason;
@@ -20,7 +20,6 @@ interface BuildToolbarOptions {
20
20
  getCanAddComments?: () => boolean;
21
21
  contentType?: string;
22
22
  }
23
- export declare const getValidNodes: (state: EditorState) => NodeType[];
24
23
  type ShouldSuppressFloatingToolbarOptions = {
25
24
  state: EditorState;
26
25
  bookmark?: SelectionBookmark;
@@ -18,7 +18,6 @@ export declare const decorationKey: {
18
18
  };
19
19
  export declare const addDraftDecoration: (start: number, end: number, targetType?: TargetType) => Decoration;
20
20
  export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
21
- export declare const isCurrentBlockNodeSelected: (state: EditorState, node: Node) => boolean;
22
21
  export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
23
22
  export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[]) => DraftBookmark;
24
23
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type AnnotationViewWrapperProps = {
2
+ type AnnotationViewWrapperProps = {
3
3
  children: React.ReactNode;
4
4
  onViewed?: () => void;
5
5
  annotationText?: string;
@@ -8,3 +8,4 @@ export declare class AnnotationViewWrapper extends React.PureComponent<Annotatio
8
8
  componentDidMount(): void;
9
9
  render(): React.ReactNode;
10
10
  }
11
+ export {};
@@ -15,10 +15,6 @@ export declare const shouldShowCommentButton: ({ state, isVisible, annotationSel
15
15
  export declare const fireOnClickAnalyticsEvent: ({ api, }: {
16
16
  api: ExtractInjectionAPI<AnnotationPlugin>;
17
17
  }) => void;
18
- export declare const fireAnnotationErrorAnalyticsEvent: ({ api, errorReason, }: {
19
- api: ExtractInjectionAPI<AnnotationPlugin>;
20
- errorReason: string;
21
- }) => void;
22
18
  export declare const fireCommentButtonViewedAnalyticsEvent: ({ api, isNonTextInlineNodeInludedInComment, annotationSelectionType, }: {
23
19
  api?: ExtractInjectionAPI<AnnotationPlugin>;
24
20
  isNonTextInlineNodeInludedInComment: boolean;
@@ -20,7 +20,6 @@ interface BuildToolbarOptions {
20
20
  getCanAddComments?: () => boolean;
21
21
  contentType?: string;
22
22
  }
23
- export declare const getValidNodes: (state: EditorState) => NodeType[];
24
23
  type ShouldSuppressFloatingToolbarOptions = {
25
24
  state: EditorState;
26
25
  bookmark?: SelectionBookmark;
@@ -18,7 +18,6 @@ export declare const decorationKey: {
18
18
  };
19
19
  export declare const addDraftDecoration: (start: number, end: number, targetType?: TargetType) => Decoration;
20
20
  export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
21
- export declare const isCurrentBlockNodeSelected: (state: EditorState, node: Node) => boolean;
22
21
  export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
23
22
  export declare const resolveDraftBookmark: (editorState: EditorState, bookmark?: SelectionBookmark, supportedBlockNodes?: string[]) => DraftBookmark;
24
23
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type AnnotationViewWrapperProps = {
2
+ type AnnotationViewWrapperProps = {
3
3
  children: React.ReactNode;
4
4
  onViewed?: () => void;
5
5
  annotationText?: string;
@@ -8,3 +8,4 @@ export declare class AnnotationViewWrapper extends React.PureComponent<Annotatio
8
8
  componentDidMount(): void;
9
9
  render(): React.ReactNode;
10
10
  }
11
+ export {};
@@ -15,10 +15,6 @@ export declare const shouldShowCommentButton: ({ state, isVisible, annotationSel
15
15
  export declare const fireOnClickAnalyticsEvent: ({ api, }: {
16
16
  api: ExtractInjectionAPI<AnnotationPlugin>;
17
17
  }) => void;
18
- export declare const fireAnnotationErrorAnalyticsEvent: ({ api, errorReason, }: {
19
- api: ExtractInjectionAPI<AnnotationPlugin>;
20
- errorReason: string;
21
- }) => void;
22
18
  export declare const fireCommentButtonViewedAnalyticsEvent: ({ api, isNonTextInlineNodeInludedInComment, annotationSelectionType, }: {
23
19
  api?: ExtractInjectionAPI<AnnotationPlugin>;
24
20
  isNonTextInlineNodeInludedInComment: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "3.3.7",
3
+ "version": "3.3.9",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,19 +36,19 @@
36
36
  "@atlaskit/editor-plugin-connectivity": "^3.1.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode-effects": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^2.0.0",
39
- "@atlaskit/editor-plugin-toolbar": "^0.3.0",
39
+ "@atlaskit/editor-plugin-toolbar": "^0.4.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
41
  "@atlaskit/editor-toolbar": "^0.3.0",
42
42
  "@atlaskit/editor-toolbar-model": "^0.1.0",
43
43
  "@atlaskit/icon": "^28.0.0",
44
44
  "@atlaskit/onboarding": "^14.3.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
46
+ "@atlaskit/tmp-editor-statsig": "^11.5.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "react-intl-next": "npm:react-intl@^5.18.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "@atlaskit/editor-common": "^107.26.0",
51
+ "@atlaskit/editor-common": "^107.28.0",
52
52
  "react": "^18.2.0",
53
53
  "react-dom": "^18.2.0"
54
54
  },