@atlaskit/editor-plugin-annotation 6.1.8 → 6.2.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-annotation
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5167552fe1a93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5167552fe1a93) -
8
+ [EDITOR-2339] Bump @atlaskit/adf-schema to 51.3.0
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 6.1.9
15
+
16
+ ### Patch Changes
17
+
18
+ - [`ef001bf65d48f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef001bf65d48f) -
19
+ Remove usage of `platform_editor_toolbar_aifc` inside editor packages - instead rely on checking
20
+ for new toolbar plugin option, make `enableNewToolbarExperience` mandatory for consumers to opt in
21
+ to new toolbar experience
22
+ - Updated dependencies
23
+
3
24
  ## 6.1.8
4
25
 
5
26
  ### Patch Changes
@@ -151,7 +172,6 @@
151
172
 
152
173
  - [`0d0fe7a300841`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d0fe7a300841) -
153
174
  Cleanup platform_editor_usesharedpluginstatewithselector experiment
154
-
155
175
  - BREAKING CHANGE: sharedPluginStateHookMigratorFactory is deleted from @atlaskit/editor-common
156
176
 
157
177
  - Updated dependencies
@@ -255,7 +275,6 @@
255
275
 
256
276
  - [`286abb4d35eba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/286abb4d35eba) -
257
277
  [ux] [ED-28960] Finish full page primary toolbar migration
258
-
259
278
  - Align with design update (separator, gap, height, icon size)
260
279
  - Add keyboard shortcut to focus toolbar and arrow key navigation
261
280
  - Address accessibility
@@ -307,7 +326,6 @@
307
326
 
308
327
  - [`3145f278b1f7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3145f278b1f7a) -
309
328
  [ux] [ED-28473] minor UI updates for editor-toolbar
310
-
311
329
  - Use ADS ButtonGroup for ToolbarButtonGroup
312
330
  - Remove groupLocation prop and use CSS instead
313
331
  - Use DropdownItemGroup for ToolbarDropdownItemSection and expand props for section separator and
@@ -454,7 +472,6 @@
454
472
  shared context or singletons.
455
473
 
456
474
  **HOW TO ADJUST:**
457
-
458
475
  - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
459
476
  any of these editor plugins.
460
477
  - Ensure the version you install matches the version required by the plugins.
@@ -1495,7 +1512,6 @@
1495
1512
  Split out side-effects from viewmode plugin to seperate plugin to reduce cyclical dependency risk
1496
1513
 
1497
1514
  # WHAT
1498
-
1499
1515
  - Remove `createFilterStepsPlugin` from the editorViewMode Plugin and is implemented in
1500
1516
  editorViewModeEffects instead.
1501
1517
  - Remove `appendTransaction` from the editorViewMode plugin and add as a new PMPlugin in
@@ -1515,7 +1531,6 @@
1515
1531
 
1516
1532
  All incompatibilities should be addressed within this changeset, however for the sake of
1517
1533
  completeness:
1518
-
1519
1534
  - `editor-plugin-editor-viewmode-effects` must be added to any preset that relies on the viewmode
1520
1535
  filter steps plugin for viewmode annotations. Currently this seems to only be the confluence
1521
1536
  editor itself.
@@ -1874,7 +1889,6 @@
1874
1889
  [ux] - Add decoration to media node when there is active draft comment associated, update plugin
1875
1890
  state mapping so that create view component is removed when there's node changes invalidating the
1876
1891
  decoration
1877
-
1878
1892
  - Save featureFlags plugin state as one of the annotation plugin state
1879
1893
 
1880
1894
  ## 1.2.2
@@ -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) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
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, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true)) {
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, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true)) {
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, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true)) {
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) && editorExperiment('platform_editor_toolbar_aifc', true, {
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 (editorExperiment('platform_editor_toolbar_aifc', true)) {
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 (editorExperiment('platform_editor_toolbar_aifc', true)) {
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) && editorExperiment('platform_editor_toolbar_aifc', true)) {
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) && editorExperiment('platform_editor_toolbar_aifc', true, {
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 (editorExperiment('platform_editor_toolbar_aifc', true)) {
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 (editorExperiment('platform_editor_toolbar_aifc', true)) {
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) && editorExperiment('platform_editor_toolbar_aifc', true)) {
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.8",
3
+ "version": "6.2.0",
4
4
  "description": "Annotation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,13 +27,13 @@
27
27
  "sideEffects": false,
28
28
  "atlaskit:src": "src/index.ts",
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^51.2.0",
30
+ "@atlaskit/adf-schema": "^51.3.0",
31
31
  "@atlaskit/analytics-next": "^11.1.0",
32
- "@atlaskit/editor-plugin-analytics": "^6.1.0",
32
+ "@atlaskit/editor-plugin-analytics": "^6.2.0",
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.2.0",
36
+ "@atlaskit/editor-plugin-toolbar": "^3.3.0",
37
37
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/editor-toolbar": "^0.15.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.8.0",
44
+ "@atlaskit/tmp-editor-statsig": "^13.13.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.10.0",
49
+ "@atlaskit/editor-common": "^110.14.0",
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },