@atlaskit/editor-plugin-annotation 6.2.6 → 6.2.8
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 +16 -0
- package/dist/cjs/annotationPlugin.js +3 -1
- package/dist/cjs/pm-plugins/inline-comment.js +0 -3
- package/dist/cjs/ui/InlineCommentView.js +1 -4
- package/dist/es2019/annotationPlugin.js +3 -1
- package/dist/es2019/pm-plugins/inline-comment.js +0 -3
- package/dist/es2019/ui/InlineCommentView.js +2 -5
- package/dist/esm/annotationPlugin.js +3 -1
- package/dist/esm/pm-plugins/inline-comment.js +0 -3
- package/dist/esm/ui/InlineCommentView.js +2 -5
- package/package.json +3 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 6.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fecf1d10a2282`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fecf1d10a2282) -
|
|
8
|
+
ED-29579 Cleaned up platform_editor_fix_inline_comment_reopen
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.2.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`749a0f6a088b9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/749a0f6a088b9) -
|
|
16
|
+
ED-29602 - stop annotationplugin breaking hydration
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.2.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -7,7 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.annotationPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
10
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
14
|
var _editorCommands = require("./editor-commands");
|
|
13
15
|
var _annotationMark = require("./nodeviews/annotationMark");
|
|
@@ -132,7 +134,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
132
134
|
contentComponent: function contentComponent(_ref3) {
|
|
133
135
|
var editorView = _ref3.editorView,
|
|
134
136
|
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
135
|
-
if (!annotationProviders || !editorView) {
|
|
137
|
+
if (!annotationProviders || !editorView || (0, _coreUtils.isSSR)() && (0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true)) {
|
|
136
138
|
return null;
|
|
137
139
|
}
|
|
138
140
|
return /*#__PURE__*/_react.default.createElement(AnnotationContentComponent, {
|
|
@@ -406,9 +406,6 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
406
406
|
},
|
|
407
407
|
click: function click(view, event) {
|
|
408
408
|
var _event$target$closest, _pluginState$selected;
|
|
409
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_listen_for_annotation_clicks')) {
|
|
410
|
-
return false;
|
|
411
|
-
}
|
|
412
409
|
if (!(event.target instanceof HTMLElement)) {
|
|
413
410
|
return false;
|
|
414
411
|
}
|
|
@@ -14,7 +14,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
14
14
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
15
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
18
|
var _editorCommands = require("../editor-commands");
|
|
20
19
|
var _utils3 = require("../pm-plugins/utils");
|
|
@@ -50,7 +49,6 @@ var selector = function selector(states) {
|
|
|
50
49
|
};
|
|
51
50
|
};
|
|
52
51
|
function InlineCommentView(_ref) {
|
|
53
|
-
var _getPluginState;
|
|
54
52
|
var providers = _ref.providers,
|
|
55
53
|
editorView = _ref.editorView,
|
|
56
54
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
@@ -65,13 +63,12 @@ function InlineCommentView(_ref) {
|
|
|
65
63
|
ViewComponent = inlineCommentProvider.viewComponent;
|
|
66
64
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(editorAPI, ['annotation'], selector),
|
|
67
65
|
annotations = _useSharedPluginState.annotations,
|
|
68
|
-
|
|
66
|
+
bookmark = _useSharedPluginState.bookmark,
|
|
69
67
|
isInlineCommentViewClosed = _useSharedPluginState.isInlineCommentViewClosed,
|
|
70
68
|
isOpeningMediaCommentFromToolbar = _useSharedPluginState.isOpeningMediaCommentFromToolbar,
|
|
71
69
|
selectAnnotationMethod = _useSharedPluginState.selectAnnotationMethod,
|
|
72
70
|
selectedAnnotations = _useSharedPluginState.selectedAnnotations,
|
|
73
71
|
isAnnotationManagerEnabled = _useSharedPluginState.isAnnotationManagerEnabled;
|
|
74
|
-
var bookmark = (0, _platformFeatureFlags.fg)('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = (0, _utils3.getPluginState)(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
|
|
75
72
|
var annotationsList = (0, _utils3.getAllAnnotations)(editorView.state.doc);
|
|
76
73
|
var selection = (0, _utils3.getSelectionPositions)(state, bookmark);
|
|
77
74
|
var position = findPosForDOM(selection);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
2
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
6
|
import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
|
|
5
7
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
@@ -125,7 +127,7 @@ export const annotationPlugin = ({
|
|
|
125
127
|
editorView,
|
|
126
128
|
dispatchAnalyticsEvent
|
|
127
129
|
}) {
|
|
128
|
-
if (!annotationProviders || !editorView) {
|
|
130
|
+
if (!annotationProviders || !editorView || isSSR() && expValEquals('platform_editor_hydratable_ui', 'isEnabled', true)) {
|
|
129
131
|
return null;
|
|
130
132
|
}
|
|
131
133
|
return /*#__PURE__*/React.createElement(AnnotationContentComponent, {
|
|
@@ -350,9 +350,6 @@ export const inlineCommentPlugin = options => {
|
|
|
350
350
|
},
|
|
351
351
|
click: (view, event) => {
|
|
352
352
|
var _event$target$closest, _pluginState$selected;
|
|
353
|
-
if (!fg('platform_editor_listen_for_annotation_clicks')) {
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
353
|
if (!(event.target instanceof HTMLElement)) {
|
|
357
354
|
return false;
|
|
358
355
|
}
|
|
@@ -5,10 +5,9 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
6
|
import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
9
|
import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
|
|
11
|
-
import { getAllAnnotations, getAnnotationViewKey,
|
|
10
|
+
import { getAllAnnotations, getAnnotationViewKey, getSelectionPositions } from '../pm-plugins/utils';
|
|
12
11
|
import { AnnotationTestIds } from '../types';
|
|
13
12
|
import { AnnotationViewWrapper } from './AnnotationViewWrapper';
|
|
14
13
|
const findPosForDOM = sel => {
|
|
@@ -46,7 +45,6 @@ export function InlineCommentView({
|
|
|
46
45
|
editorAPI,
|
|
47
46
|
dispatchAnalyticsEvent
|
|
48
47
|
}) {
|
|
49
|
-
var _getPluginState;
|
|
50
48
|
// As inlineComment is the only annotation present, this function is not generic
|
|
51
49
|
const {
|
|
52
50
|
inlineComment: inlineCommentProvider
|
|
@@ -62,14 +60,13 @@ export function InlineCommentView({
|
|
|
62
60
|
} = inlineCommentProvider;
|
|
63
61
|
const {
|
|
64
62
|
annotations,
|
|
65
|
-
bookmark
|
|
63
|
+
bookmark,
|
|
66
64
|
isInlineCommentViewClosed,
|
|
67
65
|
isOpeningMediaCommentFromToolbar,
|
|
68
66
|
selectAnnotationMethod,
|
|
69
67
|
selectedAnnotations,
|
|
70
68
|
isAnnotationManagerEnabled
|
|
71
69
|
} = useSharedPluginStateWithSelector(editorAPI, ['annotation'], selector);
|
|
72
|
-
const bookmark = fg('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = getPluginState(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
|
|
73
70
|
const annotationsList = getAllAnnotations(editorView.state.doc);
|
|
74
71
|
const selection = getSelectionPositions(state, bookmark);
|
|
75
72
|
const position = findPosForDOM(selection);
|
|
@@ -2,7 +2,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
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
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
5
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
9
|
import { setInlineCommentDraftState, showInlineCommentForBlockNode } from './editor-commands';
|
|
8
10
|
import { annotationWithToDOMFix } from './nodeviews/annotationMark';
|
|
@@ -125,7 +127,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
125
127
|
contentComponent: function contentComponent(_ref3) {
|
|
126
128
|
var editorView = _ref3.editorView,
|
|
127
129
|
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
128
|
-
if (!annotationProviders || !editorView) {
|
|
130
|
+
if (!annotationProviders || !editorView || isSSR() && expValEquals('platform_editor_hydratable_ui', 'isEnabled', true)) {
|
|
129
131
|
return null;
|
|
130
132
|
}
|
|
131
133
|
return /*#__PURE__*/React.createElement(AnnotationContentComponent, {
|
|
@@ -399,9 +399,6 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
|
|
|
399
399
|
},
|
|
400
400
|
click: function click(view, event) {
|
|
401
401
|
var _event$target$closest, _pluginState$selected;
|
|
402
|
-
if (!fg('platform_editor_listen_for_annotation_clicks')) {
|
|
403
|
-
return false;
|
|
404
|
-
}
|
|
405
402
|
if (!(event.target instanceof HTMLElement)) {
|
|
406
403
|
return false;
|
|
407
404
|
}
|
|
@@ -6,10 +6,9 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
6
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
7
7
|
import { getAnnotationInlineNodeTypes, getRangeInlineNodeNames } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
import { closeComponent, createAnnotation, removeInlineCommentNearSelection, setInlineCommentDraftState, updateInlineCommentResolvedState } from '../editor-commands';
|
|
12
|
-
import { getAllAnnotations, getAnnotationViewKey,
|
|
11
|
+
import { getAllAnnotations, getAnnotationViewKey, getSelectionPositions } from '../pm-plugins/utils';
|
|
13
12
|
import { AnnotationTestIds } from '../types';
|
|
14
13
|
import { AnnotationViewWrapper } from './AnnotationViewWrapper';
|
|
15
14
|
var findPosForDOM = function findPosForDOM(sel) {
|
|
@@ -41,7 +40,6 @@ var selector = function selector(states) {
|
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
42
|
export function InlineCommentView(_ref) {
|
|
44
|
-
var _getPluginState;
|
|
45
43
|
var providers = _ref.providers,
|
|
46
44
|
editorView = _ref.editorView,
|
|
47
45
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
@@ -56,13 +54,12 @@ export function InlineCommentView(_ref) {
|
|
|
56
54
|
ViewComponent = inlineCommentProvider.viewComponent;
|
|
57
55
|
var _useSharedPluginState = useSharedPluginStateWithSelector(editorAPI, ['annotation'], selector),
|
|
58
56
|
annotations = _useSharedPluginState.annotations,
|
|
59
|
-
|
|
57
|
+
bookmark = _useSharedPluginState.bookmark,
|
|
60
58
|
isInlineCommentViewClosed = _useSharedPluginState.isInlineCommentViewClosed,
|
|
61
59
|
isOpeningMediaCommentFromToolbar = _useSharedPluginState.isOpeningMediaCommentFromToolbar,
|
|
62
60
|
selectAnnotationMethod = _useSharedPluginState.selectAnnotationMethod,
|
|
63
61
|
selectedAnnotations = _useSharedPluginState.selectedAnnotations,
|
|
64
62
|
isAnnotationManagerEnabled = _useSharedPluginState.isAnnotationManagerEnabled;
|
|
65
|
-
var bookmark = fg('platform_editor_fix_inline_comment_reopen') ? (_getPluginState = getPluginState(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.bookmark : _bookmark;
|
|
66
63
|
var annotationsList = getAllAnnotations(editorView.state.doc);
|
|
67
64
|
var selection = getSelectionPositions(state, bookmark);
|
|
68
65
|
var position = findPosForDOM(selection);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.8",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"@atlaskit/icon": "^28.5.0",
|
|
42
42
|
"@atlaskit/onboarding": "^14.4.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^13.25.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^110.
|
|
49
|
+
"@atlaskit/editor-common": "^110.20.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
@@ -100,18 +100,12 @@
|
|
|
100
100
|
"editor_inline_comments_on_inline_nodes": {
|
|
101
101
|
"type": "boolean"
|
|
102
102
|
},
|
|
103
|
-
"platform_editor_listen_for_annotation_clicks": {
|
|
104
|
-
"type": "boolean"
|
|
105
|
-
},
|
|
106
103
|
"platform_editor_annotation_selected_annotation": {
|
|
107
104
|
"type": "boolean"
|
|
108
105
|
},
|
|
109
106
|
"confluence_frontend_preload_inline_comment_editor": {
|
|
110
107
|
"type": "boolean"
|
|
111
108
|
},
|
|
112
|
-
"platform_editor_fix_inline_comment_reopen": {
|
|
113
|
-
"type": "boolean"
|
|
114
|
-
},
|
|
115
109
|
"confluence_frontend_new_dangling_comments_ux": {
|
|
116
110
|
"type": "boolean"
|
|
117
111
|
}
|