@atlaskit/editor-plugin-annotation 6.1.7 → 6.1.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 +16 -0
- package/dist/cjs/annotationPlugin.js +1 -3
- package/dist/cjs/editor-commands/index.js +2 -3
- package/dist/cjs/pm-plugins/inline-comment.js +1 -2
- package/dist/es2019/annotationPlugin.js +1 -3
- package/dist/es2019/editor-commands/index.js +2 -3
- package/dist/es2019/pm-plugins/inline-comment.js +1 -2
- package/dist/esm/annotationPlugin.js +1 -3
- package/dist/esm/editor-commands/index.js +2 -3
- package/dist/esm/pm-plugins/inline-comment.js +1 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-annotation
|
|
2
2
|
|
|
3
|
+
## 6.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ef001bf65d48f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef001bf65d48f) -
|
|
8
|
+
Remove usage of `platform_editor_toolbar_aifc` inside editor packages - instead rely on checking
|
|
9
|
+
for new toolbar plugin option, make `enableNewToolbarExperience` mandatory for consumers to opt in
|
|
10
|
+
to new toolbar experience
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 6.1.8
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.1.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -24,9 +24,7 @@ var annotationPlugin = exports.annotationPlugin = function annotationPlugin(_ref
|
|
|
24
24
|
var annotationProviders = _ref.config,
|
|
25
25
|
api = _ref.api;
|
|
26
26
|
var featureFlags = api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
27
|
-
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar)
|
|
28
|
-
exposure: true
|
|
29
|
-
});
|
|
27
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
30
28
|
if (isToolbarAIFCEnabled) {
|
|
31
29
|
var _api$toolbar;
|
|
32
30
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api, annotationProviders));
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
12
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
14
13
|
var _types = require("../pm-plugins/types");
|
|
15
14
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -247,7 +246,7 @@ var setInlineCommentDraftState = exports.setInlineCommentDraftState = function s
|
|
|
247
246
|
var targetNodeId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
248
247
|
var isOpeningMediaCommentFromToolbar = arguments.length > 4 ? arguments[4] : undefined;
|
|
249
248
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
250
|
-
if ((0
|
|
249
|
+
if (Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
251
250
|
return function (state, dispatch) {
|
|
252
251
|
var tr = _transform.default.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod)(state.tr, state);
|
|
253
252
|
var newPluginState = commandAction(state);
|
|
@@ -289,7 +288,7 @@ var addInlineComment = exports.addInlineComment = function addInlineComment(edit
|
|
|
289
288
|
}
|
|
290
289
|
};
|
|
291
290
|
};
|
|
292
|
-
if ((0
|
|
291
|
+
if (Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar)) {
|
|
293
292
|
return function (state, dispatch) {
|
|
294
293
|
var tr = _transform.default.addInlineComment(editorAnalyticsAPI, editorAPI)(id, supportedBlockNodes)(state.tr, state);
|
|
295
294
|
tr.setMeta(_utils.inlineCommentPluginKey, commandAction(state));
|
|
@@ -14,7 +14,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
17
|
var _editorCommands = require("../editor-commands");
|
|
19
18
|
var _utils2 = require("../editor-commands/utils");
|
|
20
19
|
var _nodeviews = require("../nodeviews");
|
|
@@ -273,7 +272,7 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
273
272
|
(_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
|
|
274
273
|
}
|
|
275
274
|
var api = options.api;
|
|
276
|
-
if (isDrafting && !view.state.selection.eq(_prevState.selection) && (0
|
|
275
|
+
if (isDrafting && !view.state.selection.eq(_prevState.selection) && Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
277
276
|
// It is possible that user update selection while having a active draft,
|
|
278
277
|
// so we need to reset the user intent to allow inline text toolbar to be visible
|
|
279
278
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
@@ -15,9 +15,7 @@ export const annotationPlugin = ({
|
|
|
15
15
|
}) => {
|
|
16
16
|
var _api$featureFlags, _api$analytics;
|
|
17
17
|
const featureFlags = api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
18
|
-
const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar)
|
|
19
|
-
exposure: true
|
|
20
|
-
});
|
|
18
|
+
const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
21
19
|
if (isToolbarAIFCEnabled) {
|
|
22
20
|
var _api$toolbar;
|
|
23
21
|
api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api, annotationProviders));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
2
2
|
import { INPUT_METHOD, RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
6
5
|
import { ACTIONS } from '../pm-plugins/types';
|
|
7
6
|
import { getPluginState, inlineCommentPluginKey, isSelectionValid, isSupportedBlockNode } from '../pm-plugins/utils';
|
|
@@ -202,7 +201,7 @@ export const showInlineCommentForBlockNode = (supportedBlockNodes = []) => (node
|
|
|
202
201
|
};
|
|
203
202
|
export const setInlineCommentDraftState = (editorAnalyticsAPI, supportedBlockNodes = [], api) => (drafting, inputMethod = INPUT_METHOD.TOOLBAR, targetType = 'inline', targetNodeId = undefined, isOpeningMediaCommentFromToolbar) => {
|
|
204
203
|
const commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
205
|
-
if (
|
|
204
|
+
if (Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
206
205
|
return (state, dispatch) => {
|
|
207
206
|
const tr = transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod)(state.tr, state);
|
|
208
207
|
const newPluginState = commandAction(state);
|
|
@@ -242,7 +241,7 @@ export const addInlineComment = (editorAnalyticsAPI, editorAPI) => (id, supporte
|
|
|
242
241
|
editorState
|
|
243
242
|
}
|
|
244
243
|
});
|
|
245
|
-
if (
|
|
244
|
+
if (Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar)) {
|
|
246
245
|
return (state, dispatch) => {
|
|
247
246
|
const tr = transform.addInlineComment(editorAnalyticsAPI, editorAPI)(id, supportedBlockNodes)(state.tr, state);
|
|
248
247
|
tr.setMeta(inlineCommentPluginKey, commandAction(state));
|
|
@@ -4,7 +4,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import { getAnnotationInlineNodeTypes } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { clearDirtyMark, closeComponent, setHoveredAnnotation, setInlineCommentsVisibility, setSelectedAnnotation, flushPendingSelections, updateInlineCommentResolvedState, updateMouseState, setPendingSelectedAnnotation, setInlineCommentDraftState, setInlineCommentsFetched } from '../editor-commands';
|
|
9
8
|
import { resetUserIntent, setUserIntent } from '../editor-commands/utils';
|
|
10
9
|
import { getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
@@ -215,7 +214,7 @@ export const inlineCommentPlugin = options => {
|
|
|
215
214
|
const {
|
|
216
215
|
api
|
|
217
216
|
} = options;
|
|
218
|
-
if (isDrafting && !view.state.selection.eq(_prevState.selection) &&
|
|
217
|
+
if (isDrafting && !view.state.selection.eq(_prevState.selection) && Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
219
218
|
// It is possible that user update selection while having a active draft,
|
|
220
219
|
// so we need to reset the user intent to allow inline text toolbar to be visible
|
|
221
220
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(({
|
|
@@ -17,9 +17,7 @@ export var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
17
17
|
var annotationProviders = _ref.config,
|
|
18
18
|
api = _ref.api;
|
|
19
19
|
var featureFlags = api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState();
|
|
20
|
-
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar)
|
|
21
|
-
exposure: true
|
|
22
|
-
});
|
|
20
|
+
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
23
21
|
if (isToolbarAIFCEnabled) {
|
|
24
22
|
var _api$toolbar;
|
|
25
23
|
api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api, annotationProviders));
|
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
3
|
import { INPUT_METHOD, RESOLVE_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
7
6
|
import { ACTIONS } from '../pm-plugins/types';
|
|
8
7
|
import { getPluginState, inlineCommentPluginKey, isSelectionValid, isSupportedBlockNode } from '../pm-plugins/utils';
|
|
@@ -240,7 +239,7 @@ export var setInlineCommentDraftState = function setInlineCommentDraftState(edit
|
|
|
240
239
|
var targetNodeId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
241
240
|
var isOpeningMediaCommentFromToolbar = arguments.length > 4 ? arguments[4] : undefined;
|
|
242
241
|
var commandAction = getDraftCommandAction(drafting, targetType, targetNodeId, supportedBlockNodes, isOpeningMediaCommentFromToolbar);
|
|
243
|
-
if (
|
|
242
|
+
if (Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
244
243
|
return function (state, dispatch) {
|
|
245
244
|
var tr = transform.handleDraftState(editorAnalyticsAPI)(drafting, inputMethod)(state.tr, state);
|
|
246
245
|
var newPluginState = commandAction(state);
|
|
@@ -282,7 +281,7 @@ export var addInlineComment = function addInlineComment(editorAnalyticsAPI, edit
|
|
|
282
281
|
}
|
|
283
282
|
};
|
|
284
283
|
};
|
|
285
|
-
if (
|
|
284
|
+
if (Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar)) {
|
|
286
285
|
return function (state, dispatch) {
|
|
287
286
|
var tr = transform.addInlineComment(editorAnalyticsAPI, editorAPI)(id, supportedBlockNodes)(state.tr, state);
|
|
288
287
|
tr.setMeta(inlineCommentPluginKey, commandAction(state));
|
|
@@ -7,7 +7,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
7
7
|
import { getAnnotationInlineNodeTypes } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
import { clearDirtyMark, closeComponent, setHoveredAnnotation, setInlineCommentsVisibility, setSelectedAnnotation, flushPendingSelections, updateInlineCommentResolvedState, updateMouseState, setPendingSelectedAnnotation, setInlineCommentDraftState, setInlineCommentsFetched } from '../editor-commands';
|
|
12
11
|
import { resetUserIntent, setUserIntent } from '../editor-commands/utils';
|
|
13
12
|
import { getAnnotationViewClassname, getBlockAnnotationViewClassname } from '../nodeviews';
|
|
@@ -266,7 +265,7 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
|
|
|
266
265
|
(_options$viewInlineCo = options.viewInlineCommentTraceUFOPress) === null || _options$viewInlineCo === void 0 || _options$viewInlineCo.call(options);
|
|
267
266
|
}
|
|
268
267
|
var api = options.api;
|
|
269
|
-
if (isDrafting && !view.state.selection.eq(_prevState.selection) &&
|
|
268
|
+
if (isDrafting && !view.state.selection.eq(_prevState.selection) && Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) {
|
|
270
269
|
// It is possible that user update selection while having a active draft,
|
|
271
270
|
// so we need to reset the user intent to allow inline text toolbar to be visible
|
|
272
271
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-annotation",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.9",
|
|
4
4
|
"description": "Annotation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-editor-viewmode-effects": "^6.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
36
|
-
"@atlaskit/editor-plugin-toolbar": "^3.
|
|
36
|
+
"@atlaskit/editor-plugin-toolbar": "^3.2.0",
|
|
37
37
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
39
|
+
"@atlaskit/editor-toolbar": "^0.15.0",
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
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.10.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.10.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|