@atlaskit/editor-plugin-alignment 1.9.2 → 1.10.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,29 @@
1
1
  # @atlaskit/editor-plugin-alignment
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#126478](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126478)
8
+ [`ca1665ebbfe4d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ca1665ebbfe4d) -
9
+ [ED-23435] Store primary toolbar component registry in a plugin variable instead of in plugin
10
+ state to avoid having to add effects to all plugins and enable SSR for the toolbar. [Breaking
11
+ change] Converted registerComponent from the primary toolbar plugin into an action.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 1.9.3
18
+
19
+ ### Patch Changes
20
+
21
+ - [#125082](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125082)
22
+ [`ba605ab4da0e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ba605ab4da0e1) -
23
+ [ED-23977] This change cleans up the use of the feature flag
24
+ 'platform.editor.a11y-main-toolbar-navigation_osrty'.
25
+ - Updated dependencies
26
+
3
27
  ## 1.9.2
4
28
 
5
29
  ### Patch Changes
@@ -14,6 +14,7 @@ var defaultConfig = exports.defaultConfig = {
14
14
  align: 'start'
15
15
  };
16
16
  var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
17
+ var _api$primaryToolbar;
17
18
  var api = _ref.api;
18
19
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
19
20
  var editorView = _ref2.editorView,
@@ -32,6 +33,10 @@ var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
32
33
  isToolbarReducedSpacing: isToolbarReducedSpacing
33
34
  });
34
35
  };
36
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
37
+ name: 'alignment',
38
+ component: primaryToolbarComponent
39
+ });
35
40
  return {
36
41
  name: 'alignment',
37
42
  marks: function marks() {
@@ -64,13 +69,6 @@ var alignmentPlugin = exports.alignmentPlugin = function alignmentPlugin(_ref) {
64
69
  }
65
70
  }];
66
71
  },
67
- usePluginHook: function usePluginHook() {
68
- var _api$core, _api$primaryToolbar;
69
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
70
- name: 'alignment',
71
- component: primaryToolbarComponent
72
- }));
73
- },
74
72
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
75
73
  };
76
74
  };
@@ -80,11 +80,9 @@ var AlignmentToolbar = exports.AlignmentToolbar = /*#__PURE__*/function (_React$
80
80
  (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
81
81
  });
82
82
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function () {
83
- if ((0, _platformFeatureFlags.fg)('platform.editor.a11y-main-toolbar-navigation_osrty')) {
84
- _this.setState({
85
- isOpen: false
86
- });
87
- }
83
+ _this.setState({
84
+ isOpen: false
85
+ });
88
86
  });
89
87
  return _this;
90
88
  }
@@ -9,6 +9,7 @@ export const defaultConfig = {
9
9
  export const alignmentPlugin = ({
10
10
  api
11
11
  }) => {
12
+ var _api$primaryToolbar;
12
13
  const primaryToolbarComponent = ({
13
14
  editorView,
14
15
  popupsMountPoint,
@@ -27,6 +28,10 @@ export const alignmentPlugin = ({
27
28
  isToolbarReducedSpacing: isToolbarReducedSpacing
28
29
  });
29
30
  };
31
+ api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
32
+ name: 'alignment',
33
+ component: primaryToolbarComponent
34
+ });
30
35
  return {
31
36
  name: 'alignment',
32
37
  marks() {
@@ -56,13 +61,6 @@ export const alignmentPlugin = ({
56
61
  plugin: () => keymapPlugin()
57
62
  }];
58
63
  },
59
- usePluginHook: () => {
60
- var _api$core, _api$primaryToolbar;
61
- api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
62
- name: 'alignment',
63
- component: primaryToolbarComponent
64
- }));
65
- },
66
64
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
67
65
  };
68
66
  };
@@ -61,11 +61,9 @@ export class AlignmentToolbar extends React.Component {
61
61
  (_this$toolbarItemRef2 = this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
62
62
  });
63
63
  _defineProperty(this, "onOpenChange", () => {
64
- if (fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
65
- this.setState({
66
- isOpen: false
67
- });
68
- }
64
+ this.setState({
65
+ isOpen: false
66
+ });
69
67
  });
70
68
  }
71
69
  render() {
@@ -7,6 +7,7 @@ export var defaultConfig = {
7
7
  align: 'start'
8
8
  };
9
9
  export var alignmentPlugin = function alignmentPlugin(_ref) {
10
+ var _api$primaryToolbar;
10
11
  var api = _ref.api;
11
12
  var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
12
13
  var editorView = _ref2.editorView,
@@ -25,6 +26,10 @@ export var alignmentPlugin = function alignmentPlugin(_ref) {
25
26
  isToolbarReducedSpacing: isToolbarReducedSpacing
26
27
  });
27
28
  };
29
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
30
+ name: 'alignment',
31
+ component: primaryToolbarComponent
32
+ });
28
33
  return {
29
34
  name: 'alignment',
30
35
  marks: function marks() {
@@ -57,13 +62,6 @@ export var alignmentPlugin = function alignmentPlugin(_ref) {
57
62
  }
58
63
  }];
59
64
  },
60
- usePluginHook: function usePluginHook() {
61
- var _api$core, _api$primaryToolbar;
62
- api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
63
- name: 'alignment',
64
- component: primaryToolbarComponent
65
- }));
66
- },
67
65
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
68
66
  };
69
67
  };
@@ -76,11 +76,9 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
76
76
  (_this$toolbarItemRef2 = _this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 || (_this$toolbarItemRef2 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef2 === void 0 || _this$toolbarItemRef2.focus();
77
77
  });
78
78
  _defineProperty(_assertThisInitialized(_this), "onOpenChange", function () {
79
- if (fg('platform.editor.a11y-main-toolbar-navigation_osrty')) {
80
- _this.setState({
81
- isOpen: false
82
- });
83
- }
79
+ _this.setState({
80
+ isOpen: false
81
+ });
84
82
  });
85
83
  return _this;
86
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-alignment",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "Alignment plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,12 +22,12 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^40.3.0",
25
- "@atlaskit/editor-common": "^87.1.0",
26
- "@atlaskit/editor-plugin-primary-toolbar": "^1.3.0",
25
+ "@atlaskit/editor-common": "^87.3.0",
26
+ "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
27
27
  "@atlaskit/editor-prosemirror": "5.0.1",
28
28
  "@atlaskit/editor-tables": "^2.8.0",
29
- "@atlaskit/icon": "^22.8.0",
30
- "@atlaskit/platform-feature-flags": "^0.3.0",
29
+ "@atlaskit/icon": "^22.9.0",
30
+ "@atlaskit/platform-feature-flags": "0.3.0",
31
31
  "@atlaskit/tokens": "^1.56.0",
32
32
  "@babel/runtime": "^7.0.0",
33
33
  "@emotion/react": "^11.7.1"
@@ -93,9 +93,6 @@
93
93
  ".": "./src/index.ts"
94
94
  },
95
95
  "platform-feature-flags": {
96
- "platform.editor.a11y-main-toolbar-navigation_osrty": {
97
- "type": "boolean"
98
- },
99
96
  "platform_editor_migration_icon_and_typography": {
100
97
  "type": "boolean"
101
98
  }