@atlaskit/editor-plugin-alignment 1.16.2 → 2.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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # @atlaskit/editor-plugin-alignment
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
8
+ [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
9
+ This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
10
+ status of only supporting React 18 going forward. No explicit breaking change to React support has
11
+ been made in this release, but this is to signify going forward, breaking changes for React 16 or
12
+ React 17 may come via non-major semver releases.
13
+
14
+ Please refer this community post for more details:
15
+ https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
21
+ ## 1.17.0
22
+
23
+ ### Minor Changes
24
+
25
+ - [#116949](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116949)
26
+ [`9154f7b89e3d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9154f7b89e3d2) -
27
+ [ux] ED-26674 Hiding contextual toolbar menu items when the menu is docked to top
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies
32
+
3
33
  ## 1.16.2
4
34
 
5
35
  ### Patch Changes
@@ -73,6 +73,12 @@ var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
73
73
  },
74
74
  pluginsOptions: {
75
75
  selectionToolbar: function selectionToolbar() {
76
+ var _api$selectionToolbar;
77
+ if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
78
+ exposure: true
79
+ })) {
80
+ return undefined;
81
+ }
76
82
  if ((0, _experiments.editorExperiment)('contextual_formatting_toolbar', true, {
77
83
  exposure: true
78
84
  }) || (0, _experiments.editorExperiment)('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -8,20 +8,20 @@ exports.IconMap = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
- var _alignCenterEditorAlignCenter = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-center--editor-align-center"));
12
- var _alignLeftEditorAlignLeft = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-left--editor-align-left"));
13
- var _alignRightEditorAlignRight = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-right--editor-align-right"));
11
+ var _alignTextCenterEditorAlignCenter = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-text-center--editor-align-center"));
12
+ var _alignTextLeftEditorAlignLeft = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-text-left--editor-align-left"));
13
+ var _alignTextRightEditorAlignRight = _interopRequireDefault(require("@atlaskit/icon/core/migration/align-text-right--editor-align-right"));
14
14
  var iconAndMessageMap = {
15
15
  start: {
16
- Component: _alignLeftEditorAlignLeft.default,
16
+ Component: _alignTextLeftEditorAlignLeft.default,
17
17
  label: _messages.alignmentMessages.alignLeft
18
18
  },
19
19
  end: {
20
- Component: _alignRightEditorAlignRight.default,
20
+ Component: _alignTextRightEditorAlignRight.default,
21
21
  label: _messages.alignmentMessages.alignRight
22
22
  },
23
23
  center: {
24
- Component: _alignCenterEditorAlignCenter.default,
24
+ Component: _alignTextCenterEditorAlignCenter.default,
25
25
  label: _messages.alignmentMessages.alignCenter
26
26
  }
27
27
  };
@@ -65,6 +65,12 @@ export const alignmentPlugin = ({
65
65
  },
66
66
  pluginsOptions: {
67
67
  selectionToolbar: () => {
68
+ var _api$selectionToolbar, _api$selectionToolbar2, _api$selectionToolbar3;
69
+ if ((api === null || api === void 0 ? void 0 : (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 ? void 0 : (_api$selectionToolbar2 = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar2 === void 0 ? void 0 : (_api$selectionToolbar3 = _api$selectionToolbar2.currentState()) === null || _api$selectionToolbar3 === void 0 ? void 0 : _api$selectionToolbar3.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
70
+ exposure: true
71
+ })) {
72
+ return undefined;
73
+ }
68
74
  if (editorExperiment('contextual_formatting_toolbar', true, {
69
75
  exposure: true
70
76
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
4
- import AlignCenterIcon from '@atlaskit/icon/core/migration/align-center--editor-align-center';
5
- import AlignLeftIcon from '@atlaskit/icon/core/migration/align-left--editor-align-left';
6
- import AlignRightIcon from '@atlaskit/icon/core/migration/align-right--editor-align-right';
4
+ import AlignTextCenterIcon from '@atlaskit/icon/core/migration/align-text-center--editor-align-center';
5
+ import AlignTextLeftIcon from '@atlaskit/icon/core/migration/align-text-left--editor-align-left';
6
+ import AlignTextRightIcon from '@atlaskit/icon/core/migration/align-text-right--editor-align-right';
7
7
  const iconAndMessageMap = {
8
8
  start: {
9
- Component: AlignLeftIcon,
9
+ Component: AlignTextLeftIcon,
10
10
  label: messages.alignLeft
11
11
  },
12
12
  end: {
13
- Component: AlignRightIcon,
13
+ Component: AlignTextRightIcon,
14
14
  label: messages.alignRight
15
15
  },
16
16
  center: {
17
- Component: AlignCenterIcon,
17
+ Component: AlignTextCenterIcon,
18
18
  label: messages.alignCenter
19
19
  }
20
20
  };
@@ -66,6 +66,12 @@ export var alignmentPlugin = function alignmentPlugin(_ref) {
66
66
  },
67
67
  pluginsOptions: {
68
68
  selectionToolbar: function selectionToolbar() {
69
+ var _api$selectionToolbar;
70
+ if ((api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking) === 'top' && editorExperiment('platform_editor_controls', 'variant1', {
71
+ exposure: true
72
+ })) {
73
+ return undefined;
74
+ }
69
75
  if (editorExperiment('contextual_formatting_toolbar', true, {
70
76
  exposure: true
71
77
  }) || editorExperiment('platform_editor_contextual_formatting_toolbar_v2', 'variant1', {
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { alignmentMessages as messages } from '@atlaskit/editor-common/messages';
4
- import AlignCenterIcon from '@atlaskit/icon/core/migration/align-center--editor-align-center';
5
- import AlignLeftIcon from '@atlaskit/icon/core/migration/align-left--editor-align-left';
6
- import AlignRightIcon from '@atlaskit/icon/core/migration/align-right--editor-align-right';
4
+ import AlignTextCenterIcon from '@atlaskit/icon/core/migration/align-text-center--editor-align-center';
5
+ import AlignTextLeftIcon from '@atlaskit/icon/core/migration/align-text-left--editor-align-left';
6
+ import AlignTextRightIcon from '@atlaskit/icon/core/migration/align-text-right--editor-align-right';
7
7
  var iconAndMessageMap = {
8
8
  start: {
9
- Component: AlignLeftIcon,
9
+ Component: AlignTextLeftIcon,
10
10
  label: messages.alignLeft
11
11
  },
12
12
  end: {
13
- Component: AlignRightIcon,
13
+ Component: AlignTextRightIcon,
14
14
  label: messages.alignRight
15
15
  },
16
16
  center: {
17
- Component: AlignCenterIcon,
17
+ Component: AlignTextCenterIcon,
18
18
  label: messages.alignCenter
19
19
  }
20
20
  };
@@ -1,7 +1,11 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
3
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
3
4
  import type { AlignmentPluginState } from './pm-plugins/types';
4
- export type AlignmentPluginDependencies = [OptionalPlugin<PrimaryToolbarPlugin>];
5
+ export type AlignmentPluginDependencies = [
6
+ OptionalPlugin<PrimaryToolbarPlugin>,
7
+ OptionalPlugin<SelectionToolbarPlugin>
8
+ ];
5
9
  export type AlignmentPlugin = NextEditorPlugin<'alignment', {
6
10
  sharedState: AlignmentPluginState | undefined;
7
11
  dependencies: AlignmentPluginDependencies;
@@ -1,8 +1,10 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
3
+ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
3
4
  import type { AlignmentPluginState } from './pm-plugins/types';
4
5
  export type AlignmentPluginDependencies = [
5
- OptionalPlugin<PrimaryToolbarPlugin>
6
+ OptionalPlugin<PrimaryToolbarPlugin>,
7
+ OptionalPlugin<SelectionToolbarPlugin>
6
8
  ];
7
9
  export type AlignmentPlugin = NextEditorPlugin<'alignment', {
8
10
  sharedState: AlignmentPluginState | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-alignment",
3
- "version": "1.16.2",
3
+ "version": "2.0.0",
4
4
  "description": "Alignment plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -21,26 +21,27 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@atlaskit/adf-schema": "^47.2.1",
24
- "@atlaskit/editor-common": "^99.17.0",
25
- "@atlaskit/editor-plugin-primary-toolbar": "^2.2.0",
24
+ "@atlaskit/editor-common": "^100.0.0",
25
+ "@atlaskit/editor-plugin-primary-toolbar": "^3.0.0",
26
+ "@atlaskit/editor-plugin-selection-toolbar": "^2.0.0",
26
27
  "@atlaskit/editor-prosemirror": "7.0.0",
27
28
  "@atlaskit/editor-tables": "^2.9.0",
28
- "@atlaskit/icon": "^23.9.0",
29
+ "@atlaskit/icon": "^24.0.0",
29
30
  "@atlaskit/platform-feature-flags": "1.1.0",
30
- "@atlaskit/tmp-editor-statsig": "^2.46.0",
31
- "@atlaskit/tokens": "^3.3.0",
31
+ "@atlaskit/tmp-editor-statsig": "^3.0.0",
32
+ "@atlaskit/tokens": "^4.0.0",
32
33
  "@babel/runtime": "^7.0.0",
33
34
  "@emotion/react": "^11.7.1"
34
35
  },
35
36
  "peerDependencies": {
36
- "react": "^16.8.0 || ^17.0.0 || ~18.2.0",
37
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.2.0",
37
+ "react": "^18.2.0",
38
+ "react-dom": "^18.2.0",
38
39
  "react-intl-next": "npm:react-intl@^5.18.1"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@af/integration-testing": "*",
42
43
  "@af/visual-regression": "*",
43
- "@atlaskit/editor-plugin-list": "^3.10.0",
44
+ "@atlaskit/editor-plugin-list": "^4.0.0",
44
45
  "@atlaskit/ssr": "*",
45
46
  "@atlaskit/visual-regression": "*",
46
47
  "@testing-library/react": "^13.4.0",