@atlaskit/editor-plugin-annotation 2.9.10 → 3.0.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.
- package/CHANGELOG.md +48 -0
- package/dist/cjs/annotationPlugin.js +0 -4
- package/dist/cjs/pm-plugins/toolbar.js +1 -10
- package/dist/es2019/annotationPlugin.js +0 -4
- package/dist/es2019/pm-plugins/toolbar.js +1 -14
- package/dist/esm/annotationPlugin.js +0 -4
- package/dist/esm/pm-plugins/toolbar.js +1 -10
- package/package.json +9 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
|
|
8
|
+
[`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
|
|
9
|
+
Make `@atlaskit/editor-common` a peer dependency
|
|
10
|
+
|
|
11
|
+
**WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
|
|
12
|
+
all editor plugin packages.
|
|
13
|
+
|
|
14
|
+
**WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
|
|
15
|
+
consuming applications, preventing issues caused by multiple versions of singleton libraries (such
|
|
16
|
+
as context mismatches or duplicated state). This is especially important for packages that rely on
|
|
17
|
+
shared context or singletons.
|
|
18
|
+
|
|
19
|
+
**HOW TO ADJUST:**
|
|
20
|
+
|
|
21
|
+
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
22
|
+
any of these editor plugins.
|
|
23
|
+
- Ensure the version you install matches the version required by the plugins.
|
|
24
|
+
- You can use the
|
|
25
|
+
[`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
|
|
26
|
+
verify that all required peer dependencies are installed and compatible.
|
|
27
|
+
- Example install command:
|
|
28
|
+
```
|
|
29
|
+
npm install @atlaskit/editor-common
|
|
30
|
+
```
|
|
31
|
+
or
|
|
32
|
+
```
|
|
33
|
+
yarn add @atlaskit/editor-common
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
|
|
37
|
+
application level, you may see errors or unexpected behavior.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
43
|
+
## 2.9.11
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- [#179350](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179350)
|
|
48
|
+
[`9395a7b026838`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9395a7b026838) -
|
|
49
|
+
Clean up platform_editor_fix_toolbar_comment_jump
|
|
50
|
+
|
|
3
51
|
## 2.9.10
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
11
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var _editorCommands = require("./editor-commands");
|
|
15
14
|
var _annotationMark = require("./nodeviews/annotationMark");
|
|
@@ -81,9 +80,6 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
81
80
|
},
|
|
82
81
|
pluginsOptions: {
|
|
83
82
|
floatingToolbar: function floatingToolbar(state) {
|
|
84
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_fix_toolbar_comment_jump')) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
83
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
88
84
|
var bookmark = pluginState === null || pluginState === void 0 ? void 0 : pluginState.bookmark;
|
|
89
85
|
if ((0, _toolbar.shouldSuppressFloatingToolbar)({
|
|
@@ -69,7 +69,6 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
|
|
|
69
69
|
createCommentExperience = _ref2.createCommentExperience,
|
|
70
70
|
annotationManager = _ref2.annotationManager,
|
|
71
71
|
onCommentButtonMount = _ref2.onCommentButtonMount;
|
|
72
|
-
var schema = state.schema;
|
|
73
72
|
var selectionValid = (0, _utils2.isSelectionValid)(state);
|
|
74
73
|
var isMediaSelected = (0, _mediaSingle.currentMediaNodeWithPos)(state);
|
|
75
74
|
|
|
@@ -183,20 +182,12 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsA
|
|
|
183
182
|
},
|
|
184
183
|
supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
|
|
185
184
|
};
|
|
186
|
-
var annotation = schema.marks.annotation;
|
|
187
|
-
var validNodes = Object.keys(schema.nodes).reduce(function (acc, current) {
|
|
188
|
-
var type = schema.nodes[current];
|
|
189
|
-
if (type.allowsMarkType(annotation)) {
|
|
190
|
-
acc.push(type);
|
|
191
|
-
}
|
|
192
|
-
return acc;
|
|
193
|
-
}, []);
|
|
194
185
|
var toolbarTitle = intl.formatMessage(_messages.annotationMessages.toolbar);
|
|
195
186
|
var calcToolbarPosition = isToolbarAbove ? _utils.calculateToolbarPositionAboveSelection : _utils.calculateToolbarPositionTrackHead;
|
|
196
187
|
var onPositionCalculated = calcToolbarPosition(toolbarTitle);
|
|
197
188
|
return {
|
|
198
189
|
title: toolbarTitle,
|
|
199
|
-
nodeType:
|
|
190
|
+
nodeType: getValidNodes(state),
|
|
200
191
|
items: [createComment],
|
|
201
192
|
onPositionCalculated: onPositionCalculated,
|
|
202
193
|
pluginName: 'annotation'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
|
|
7
6
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
@@ -71,9 +70,6 @@ export const annotationPlugin = ({
|
|
|
71
70
|
}],
|
|
72
71
|
pluginsOptions: {
|
|
73
72
|
floatingToolbar(state) {
|
|
74
|
-
if (!fg('platform_editor_fix_toolbar_comment_jump')) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
73
|
const pluginState = getPluginState(state);
|
|
78
74
|
const bookmark = pluginState === null || pluginState === void 0 ? void 0 : pluginState.bookmark;
|
|
79
75
|
if (shouldSuppressFloatingToolbar({
|
|
@@ -67,9 +67,6 @@ export const buildToolbar = editorAnalyticsAPI => ({
|
|
|
67
67
|
onCommentButtonMount
|
|
68
68
|
}) => {
|
|
69
69
|
var _api$connectivity, _api$connectivity$sha, _api$connectivity$sha2;
|
|
70
|
-
const {
|
|
71
|
-
schema
|
|
72
|
-
} = state;
|
|
73
70
|
const selectionValid = isSelectionValid(state);
|
|
74
71
|
const isMediaSelected = currentMediaNodeWithPos(state);
|
|
75
72
|
|
|
@@ -181,22 +178,12 @@ export const buildToolbar = editorAnalyticsAPI => ({
|
|
|
181
178
|
},
|
|
182
179
|
supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
|
|
183
180
|
};
|
|
184
|
-
const {
|
|
185
|
-
annotation
|
|
186
|
-
} = schema.marks;
|
|
187
|
-
const validNodes = Object.keys(schema.nodes).reduce((acc, current) => {
|
|
188
|
-
const type = schema.nodes[current];
|
|
189
|
-
if (type.allowsMarkType(annotation)) {
|
|
190
|
-
acc.push(type);
|
|
191
|
-
}
|
|
192
|
-
return acc;
|
|
193
|
-
}, []);
|
|
194
181
|
const toolbarTitle = intl.formatMessage(annotationMessages.toolbar);
|
|
195
182
|
const calcToolbarPosition = isToolbarAbove ? calculateToolbarPositionAboveSelection : calculateToolbarPositionTrackHead;
|
|
196
183
|
const onPositionCalculated = calcToolbarPosition(toolbarTitle);
|
|
197
184
|
return {
|
|
198
185
|
title: toolbarTitle,
|
|
199
|
-
nodeType:
|
|
186
|
+
nodeType: getValidNodes(state),
|
|
200
187
|
items: [createComment],
|
|
201
188
|
onPositionCalculated,
|
|
202
189
|
pluginName: 'annotation'
|
|
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
8
|
import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
|
|
10
9
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
@@ -74,9 +73,6 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
74
73
|
},
|
|
75
74
|
pluginsOptions: {
|
|
76
75
|
floatingToolbar: function floatingToolbar(state) {
|
|
77
|
-
if (!fg('platform_editor_fix_toolbar_comment_jump')) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
76
|
var pluginState = getPluginState(state);
|
|
81
77
|
var bookmark = pluginState === null || pluginState === void 0 ? void 0 : pluginState.bookmark;
|
|
82
78
|
if (shouldSuppressFloatingToolbar({
|
|
@@ -62,7 +62,6 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
|
|
|
62
62
|
createCommentExperience = _ref2.createCommentExperience,
|
|
63
63
|
annotationManager = _ref2.annotationManager,
|
|
64
64
|
onCommentButtonMount = _ref2.onCommentButtonMount;
|
|
65
|
-
var schema = state.schema;
|
|
66
65
|
var selectionValid = isSelectionValid(state);
|
|
67
66
|
var isMediaSelected = currentMediaNodeWithPos(state);
|
|
68
67
|
|
|
@@ -176,20 +175,12 @@ export var buildToolbar = function buildToolbar(editorAnalyticsAPI) {
|
|
|
176
175
|
},
|
|
177
176
|
supportsViewMode: true // TODO: MODES-3950 - Clean up this floating toolbar view mode logic,
|
|
178
177
|
};
|
|
179
|
-
var annotation = schema.marks.annotation;
|
|
180
|
-
var validNodes = Object.keys(schema.nodes).reduce(function (acc, current) {
|
|
181
|
-
var type = schema.nodes[current];
|
|
182
|
-
if (type.allowsMarkType(annotation)) {
|
|
183
|
-
acc.push(type);
|
|
184
|
-
}
|
|
185
|
-
return acc;
|
|
186
|
-
}, []);
|
|
187
178
|
var toolbarTitle = intl.formatMessage(annotationMessages.toolbar);
|
|
188
179
|
var calcToolbarPosition = isToolbarAbove ? calculateToolbarPositionAboveSelection : calculateToolbarPositionTrackHead;
|
|
189
180
|
var onPositionCalculated = calcToolbarPosition(toolbarTitle);
|
|
190
181
|
return {
|
|
191
182
|
title: toolbarTitle,
|
|
192
|
-
nodeType:
|
|
183
|
+
nodeType: getValidNodes(state),
|
|
193
184
|
items: [createComment],
|
|
194
185
|
onPositionCalculated: onPositionCalculated,
|
|
195
186
|
pluginName: 'annotation'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: AI",
|
|
12
|
-
"singleton": true
|
|
13
|
-
"runReact18": true
|
|
12
|
+
"singleton": true
|
|
14
13
|
},
|
|
15
14
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
16
15
|
"main": "dist/cjs/index.js",
|
|
@@ -33,19 +32,19 @@
|
|
|
33
32
|
"dependencies": {
|
|
34
33
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
34
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
36
|
-
"@atlaskit/editor-
|
|
37
|
-
"@atlaskit/editor-plugin-
|
|
38
|
-
"@atlaskit/editor-plugin-
|
|
39
|
-
"@atlaskit/editor-plugin-
|
|
40
|
-
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
35
|
+
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-connectivity": "^3.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-viewmode-effects": "^3.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-feature-flags": "^2.0.0",
|
|
41
39
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/icon": "^27.
|
|
40
|
+
"@atlaskit/icon": "^27.2.0",
|
|
43
41
|
"@atlaskit/onboarding": "^14.2.0",
|
|
44
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
43
|
+
"@atlaskit/tmp-editor-statsig": "^8.7.0",
|
|
46
44
|
"@babel/runtime": "^7.0.0"
|
|
47
45
|
},
|
|
48
46
|
"peerDependencies": {
|
|
47
|
+
"@atlaskit/editor-common": "^107.6.0",
|
|
49
48
|
"react": "^18.2.0",
|
|
50
49
|
"react-dom": "^18.2.0"
|
|
51
50
|
},
|
|
@@ -107,9 +106,6 @@
|
|
|
107
106
|
"platform_editor_listen_for_annotation_clicks": {
|
|
108
107
|
"type": "boolean"
|
|
109
108
|
},
|
|
110
|
-
"platform_editor_fix_toolbar_comment_jump": {
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
},
|
|
113
109
|
"platform_editor_annotation_selected_annotation": {
|
|
114
110
|
"type": "boolean"
|
|
115
111
|
},
|