@atlaskit/editor-plugin-annotation 1.25.7 → 1.26.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 1.26.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#175552](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/175552)
8
+ [`b29361001f720`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b29361001f720) -
9
+ refactor: remediate re-exports in editor-plugin-ai-definitions, editor-plugin-alignment,
10
+ editor-plugin-analytics, editor-plugin-annotation
11
+ - Updated dependencies
12
+
13
+ ## 1.26.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#173684](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/173684)
18
+ [`e022c83d84bd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e022c83d84bd3) -
19
+ Fix errors caused by not checking for undefined annotation toolbar
20
+
3
21
  ## 1.25.7
4
22
 
5
23
  ### Patch Changes
@@ -4,17 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "AnnotationUpdateEmitter", {
8
- enumerable: true,
9
- get: function get() {
10
- return _annotation.AnnotationUpdateEmitter;
11
- }
12
- });
13
7
  exports.annotationPlugin = void 0;
14
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
9
  var _react = _interopRequireDefault(require("react"));
16
10
  var _adfSchema = require("@atlaskit/adf-schema");
17
- var _annotation = require("@atlaskit/editor-common/annotation");
18
11
  var _hooks = require("@atlaskit/editor-common/hooks");
19
12
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
20
13
  var _editorCommands = require("./editor-commands");
@@ -98,9 +91,13 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
98
91
  isToolbarAbove: isToolbarAbove,
99
92
  api: api
100
93
  });
101
- return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
102
- rank: (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) ? 1 : undefined
103
- });
94
+ if (!toolbarConfig) {
95
+ return undefined;
96
+ } else {
97
+ return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
98
+ rank: (0, _experiments.editorExperiment)('contextual_formatting_toolbar', true) ? 1 : undefined
99
+ });
100
+ }
104
101
  }
105
102
  }
106
103
  },
@@ -5,20 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.addDraftDecoration = void 0;
7
7
  exports.annotationExists = annotationExists;
8
- Object.defineProperty(exports, "containsAnyAnnotations", {
9
- enumerable: true,
10
- get: function get() {
11
- return _utils.containsAnyAnnotations;
12
- }
13
- });
14
8
  exports.getPluginState = exports.getDraftCommandAnalyticsPayload = exports.getAnnotationViewKey = exports.getAllAnnotations = exports.findAnnotationsInSelection = exports.decorationKey = void 0;
15
9
  exports.getSelectionPositions = getSelectionPositions;
16
- Object.defineProperty(exports, "hasAnnotationMark", {
17
- enumerable: true,
18
- get: function get() {
19
- return _utils.hasAnnotationMark;
20
- }
21
- });
22
10
  exports.hasInvalidNodes = void 0;
23
11
  exports.hasInvalidWhitespaceNode = hasInvalidWhitespaceNode;
24
12
  exports.isCurrentBlockNodeSelected = exports.isBlockNodeAnnotationsSelected = exports.inlineCommentPluginKey = void 0;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { annotation } from '@atlaskit/adf-schema';
3
- import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
4
3
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
5
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
5
  import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
@@ -84,10 +83,14 @@ export const annotationPlugin = ({
84
83
  isToolbarAbove,
85
84
  api
86
85
  });
87
- return {
88
- ...toolbarConfig,
89
- rank: editorExperiment('contextual_formatting_toolbar', true) ? 1 : undefined
90
- };
86
+ if (!toolbarConfig) {
87
+ return undefined;
88
+ } else {
89
+ return {
90
+ ...toolbarConfig,
91
+ rank: editorExperiment('contextual_formatting_toolbar', true) ? 1 : undefined
92
+ };
93
+ }
91
94
  }
92
95
  }
93
96
  },
@@ -129,5 +132,4 @@ function AnnotationContentComponent({
129
132
  editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions,
130
133
  editorAPI: api
131
134
  }));
132
- }
133
- export { AnnotationUpdateEmitter };
135
+ }
@@ -1 +1,4 @@
1
+ // Disable no-re-export rule for entry point files
2
+ /* eslint-disable @atlaskit/editor/no-re-export */
3
+
1
4
  export { annotationPlugin } from './annotationPlugin';
@@ -2,12 +2,11 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
2
2
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
3
3
  import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
4
4
  import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
5
- import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, isParagraph, isText } from '@atlaskit/editor-common/utils';
5
+ import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, isParagraph, isText } from '@atlaskit/editor-common/utils';
6
6
  import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { AnnotationSelectionType } from '../types';
10
- export { hasAnnotationMark, containsAnyAnnotations };
11
10
  function sum(arr, f) {
12
11
  return arr.reduce((val, x) => val + f(x), 0);
13
12
  }
@@ -3,7 +3,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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) { _defineProperty(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; }
4
4
  import React from 'react';
5
5
  import { annotation } from '@atlaskit/adf-schema';
6
- import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
7
6
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
8
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
8
  import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
@@ -85,9 +84,13 @@ export var annotationPlugin = function annotationPlugin(_ref) {
85
84
  isToolbarAbove: isToolbarAbove,
86
85
  api: api
87
86
  });
88
- return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
89
- rank: editorExperiment('contextual_formatting_toolbar', true) ? 1 : undefined
90
- });
87
+ if (!toolbarConfig) {
88
+ return undefined;
89
+ } else {
90
+ return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
91
+ rank: editorExperiment('contextual_formatting_toolbar', true) ? 1 : undefined
92
+ });
93
+ }
91
94
  }
92
95
  }
93
96
  },
@@ -126,5 +129,4 @@ function AnnotationContentComponent(_ref4) {
126
129
  editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions,
127
130
  editorAPI: api
128
131
  }));
129
- }
130
- export { AnnotationUpdateEmitter };
132
+ }
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
+ // Disable no-re-export rule for entry point files
2
+ /* eslint-disable @atlaskit/editor/no-re-export */
3
+
1
4
  export { annotationPlugin } from './annotationPlugin';
@@ -2,12 +2,11 @@ import { AnnotationTypes } from '@atlaskit/adf-schema';
2
2
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
3
3
  import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
4
4
  import { AnnotationSharedClassNames, BlockAnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
5
- import { canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, isParagraph, isText } from '@atlaskit/editor-common/utils';
5
+ import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, getRangeInlineNodeNames, hasAnnotationMark, isEmptyTextSelection, isParagraph, isText } from '@atlaskit/editor-common/utils';
6
6
  import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { AnnotationSelectionType } from '../types';
10
- export { hasAnnotationMark, containsAnyAnnotations };
11
10
  function sum(arr, f) {
12
11
  return arr.reduce(function (val, x) {
13
12
  return val + f(x);
@@ -1,7 +1,2 @@
1
- import type { UpdateEvent } from '@atlaskit/editor-common/annotation';
2
- import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
3
1
  import type { AnnotationPlugin } from './annotationPluginType';
4
- import type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentState, InlineCommentViewComponentProps } from './types';
5
2
  export declare const annotationPlugin: AnnotationPlugin;
6
- export { AnnotationUpdateEmitter };
7
- export type { AnnotationProviders, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentViewComponentProps, AnnotationTypeProvider, AnnotationInfo, AnnotationState, InlineCommentState, UpdateEvent, };
@@ -1,5 +1,4 @@
1
1
  import type { AnalyticsEventPayloadCallback } from '@atlaskit/editor-common/analytics';
2
- import { containsAnyAnnotations, hasAnnotationMark } from '@atlaskit/editor-common/utils';
3
2
  import type { Mark, Node, ResolvedPos, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
4
3
  import type { EditorState, Selection, SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
5
4
  import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
@@ -7,7 +6,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
7
6
  import type { AnnotationInfo, DraftBookmark, InlineCommentInputMethod, TargetType } from '../types';
8
7
  import { AnnotationSelectionType } from '../types';
9
8
  import type { InlineCommentPluginState } from './types';
10
- export { hasAnnotationMark, containsAnyAnnotations };
11
9
  /**
12
10
  * Finds the marks in the nodes to the left and right.
13
11
  * @param $pos Position to center search around
@@ -1,7 +1,2 @@
1
- import type { UpdateEvent } from '@atlaskit/editor-common/annotation';
2
- import { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
3
1
  import type { AnnotationPlugin } from './annotationPluginType';
4
- import type { AnnotationInfo, AnnotationProviders, AnnotationState, AnnotationTypeProvider, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentState, InlineCommentViewComponentProps } from './types';
5
2
  export declare const annotationPlugin: AnnotationPlugin;
6
- export { AnnotationUpdateEmitter };
7
- export type { AnnotationProviders, InlineCommentAnnotationProvider, InlineCommentCreateComponentProps, InlineCommentViewComponentProps, AnnotationTypeProvider, AnnotationInfo, AnnotationState, InlineCommentState, UpdateEvent, };
@@ -1,5 +1,4 @@
1
1
  import type { AnalyticsEventPayloadCallback } from '@atlaskit/editor-common/analytics';
2
- import { containsAnyAnnotations, hasAnnotationMark } from '@atlaskit/editor-common/utils';
3
2
  import type { Mark, Node, ResolvedPos, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
4
3
  import type { EditorState, Selection, SelectionBookmark } from '@atlaskit/editor-prosemirror/state';
5
4
  import { AllSelection, NodeSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
@@ -7,7 +6,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
7
6
  import type { AnnotationInfo, DraftBookmark, InlineCommentInputMethod, TargetType } from '../types';
8
7
  import { AnnotationSelectionType } from '../types';
9
8
  import type { InlineCommentPluginState } from './types';
10
- export { hasAnnotationMark, containsAnyAnnotations };
11
9
  /**
12
10
  * Finds the marks in the nodes to the left and right.
13
11
  * @param $pos Position to center search around
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-annotation",
3
- "version": "1.25.7",
3
+ "version": "1.26.1",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^96.1.0",
35
+ "@atlaskit/editor-common": "^96.3.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode-effects": "^1.1.0",
38
38
  "@atlaskit/editor-plugin-engagement-platform": "^2.1.0",
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
40
40
  "@atlaskit/editor-prosemirror": "6.2.1",
41
- "@atlaskit/icon": "^23.0.0",
41
+ "@atlaskit/icon": "^23.1.0",
42
42
  "@atlaskit/onboarding": "^12.1.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
- "@atlaskit/tmp-editor-statsig": "^2.22.0",
44
+ "@atlaskit/tmp-editor-statsig": "^2.23.0",
45
45
  "@babel/runtime": "^7.0.0"
46
46
  },
47
47
  "peerDependencies": {