@atlaskit/editor-plugin-block-type 3.10.1 → 3.11.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,28 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 3.11.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
+ ## 3.10.2
18
+
19
+ ### Patch Changes
20
+
21
+ - [#125353](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125353)
22
+ [`77847728bf617`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77847728bf617) -
23
+ Migrate icons in Editor primary toolbar
24
+ - Updated dependencies
25
+
3
26
  ## 3.10.1
4
27
 
5
28
  ### Patch Changes
@@ -101,6 +101,7 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
101
101
  }];
102
102
  };
103
103
  var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3) {
104
+ var _api$primaryToolbar;
104
105
  var options = _ref3.config,
105
106
  api = _ref3.api;
106
107
  var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
@@ -122,6 +123,10 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
122
123
  shouldUseDefaultRole: false
123
124
  });
124
125
  };
126
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
127
+ name: 'blockType',
128
+ component: primaryToolbarComponent
129
+ });
125
130
  return {
126
131
  name: 'blockType',
127
132
  nodes: function nodes() {
@@ -190,13 +195,6 @@ var blockTypePlugin = exports.blockTypePlugin = function blockTypePlugin(_ref3)
190
195
  }
191
196
  return _main.pluginKey.getState(editorState);
192
197
  },
193
- usePluginHook: function usePluginHook() {
194
- var _api$core, _api$primaryToolbar;
195
- 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({
196
- name: 'blockType',
197
- component: primaryToolbarComponent
198
- }));
199
- },
200
198
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
201
199
  pluginsOptions: {
202
200
  quickInsert: function quickInsert(intl) {
@@ -11,8 +11,11 @@ var _reactIntlNext = require("react-intl-next");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _styles = require("@atlaskit/editor-common/styles");
13
13
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
14
+ var _textStyleEditorTextStyle = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-style--editor-text-style"));
14
15
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
15
16
  var _textStyle = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/text-style"));
17
+ var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
19
  var _blockTypes = require("../../block-types");
17
20
  var _styled = require("./styled");
18
21
  /**
@@ -45,14 +48,21 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
45
48
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
46
49
  css: [_styles.wrapperStyle, props.isSmall && _styled.wrapperSmallStyle],
47
50
  "data-testid": "toolbar-block-type-text-styles-icon"
48
- }, props.isSmall && (0, _react2.jsx)(_textStyle.default, {
51
+ }, (0, _platformFeatureFlags.fg)('platform_editor_migration_icon_and_typography') ? (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (0, _react2.jsx)(_textStyleEditorTextStyle.default, {
52
+ label: labelTextStyles,
53
+ spacing: "spacious",
54
+ color: "currentColor"
55
+ }), (0, _react2.jsx)(_chevronDown2.default, {
56
+ label: "",
57
+ color: "currentColor"
58
+ })) : (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (0, _react2.jsx)(_textStyle.default, {
49
59
  label: labelTextStyles
50
60
  }), (0, _react2.jsx)("span", {
51
61
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
52
62
  css: _styled.expandIconWrapperStyle
53
63
  }, (0, _react2.jsx)(_chevronDown.default, {
54
64
  label: ""
55
- })))
65
+ }))))
56
66
  }, !props.isSmall && (0, _react2.jsx)("span", {
57
67
  css: [
58
68
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -88,6 +88,7 @@ const blockTypePlugin = ({
88
88
  config: options,
89
89
  api
90
90
  }) => {
91
+ var _api$primaryToolbar;
91
92
  const primaryToolbarComponent = ({
92
93
  popupsMountPoint,
93
94
  popupsBoundariesElement,
@@ -108,6 +109,10 @@ const blockTypePlugin = ({
108
109
  shouldUseDefaultRole: false
109
110
  });
110
111
  };
112
+ api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.actions.registerComponent({
113
+ name: 'blockType',
114
+ component: primaryToolbarComponent
115
+ });
111
116
  return {
112
117
  name: 'blockType',
113
118
  nodes() {
@@ -175,13 +180,6 @@ const blockTypePlugin = ({
175
180
  }
176
181
  return pluginKey.getState(editorState);
177
182
  },
178
- usePluginHook: () => {
179
- var _api$core, _api$primaryToolbar;
180
- 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({
181
- name: 'blockType',
182
- component: primaryToolbarComponent
183
- }));
184
- },
185
183
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
186
184
  pluginsOptions: {
187
185
  quickInsert: intl => {
@@ -10,8 +10,11 @@ import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
11
  import { wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
- import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
14
- import TextStyleIcon from '@atlaskit/icon/glyph/editor/text-style';
13
+ import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
14
+ import { default as ExpandIcon } from '@atlaskit/icon/glyph/chevron-down';
15
+ import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
15
18
  import { NORMAL_TEXT } from '../../block-types';
16
19
  import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
17
20
  export const BlockTypeButton = props => {
@@ -37,14 +40,21 @@ export const BlockTypeButton = props => {
37
40
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
38
41
  css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
39
42
  "data-testid": "toolbar-block-type-text-styles-icon"
40
- }, props.isSmall && jsx(TextStyleIcon, {
43
+ }, fg('platform_editor_migration_icon_and_typography') ? jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
44
+ label: labelTextStyles,
45
+ spacing: "spacious",
46
+ color: "currentColor"
47
+ }), jsx(ChevronDownIcon, {
48
+ label: "",
49
+ color: "currentColor"
50
+ })) : jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIconLegacy, {
41
51
  label: labelTextStyles
42
52
  }), jsx("span", {
43
53
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
44
54
  css: expandIconWrapperStyle
45
55
  }, jsx(ExpandIcon, {
46
56
  label: ""
47
- })))
57
+ }))))
48
58
  }, !props.isSmall && jsx("span", {
49
59
  css: [
50
60
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -88,6 +88,7 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
88
88
  }];
89
89
  };
90
90
  var blockTypePlugin = function blockTypePlugin(_ref3) {
91
+ var _api$primaryToolbar;
91
92
  var options = _ref3.config,
92
93
  api = _ref3.api;
93
94
  var primaryToolbarComponent = function primaryToolbarComponent(_ref4) {
@@ -109,6 +110,10 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
109
110
  shouldUseDefaultRole: false
110
111
  });
111
112
  };
113
+ api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 || _api$primaryToolbar.actions.registerComponent({
114
+ name: 'blockType',
115
+ component: primaryToolbarComponent
116
+ });
112
117
  return {
113
118
  name: 'blockType',
114
119
  nodes: function nodes() {
@@ -177,13 +182,6 @@ var blockTypePlugin = function blockTypePlugin(_ref3) {
177
182
  }
178
183
  return pluginKey.getState(editorState);
179
184
  },
180
- usePluginHook: function usePluginHook() {
181
- var _api$core, _api$primaryToolbar;
182
- 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({
183
- name: 'blockType',
184
- component: primaryToolbarComponent
185
- }));
186
- },
187
185
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined,
188
186
  pluginsOptions: {
189
187
  quickInsert: function quickInsert(intl) {
@@ -10,8 +10,11 @@ import { FormattedMessage } from 'react-intl-next';
10
10
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
11
11
  import { wrapperStyle } from '@atlaskit/editor-common/styles';
12
12
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
13
- import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
14
- import TextStyleIcon from '@atlaskit/icon/glyph/editor/text-style';
13
+ import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
14
+ import { default as ExpandIcon } from '@atlaskit/icon/glyph/chevron-down';
15
+ import { default as TextStyleIconLegacy } from '@atlaskit/icon/glyph/editor/text-style';
16
+ import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
15
18
  import { NORMAL_TEXT } from '../../block-types';
16
19
  import { buttonContentReducedSpacingStyle, buttonContentStyle, expandIconWrapperStyle, wrapperSmallStyle } from './styled';
17
20
  export var BlockTypeButton = function BlockTypeButton(props) {
@@ -37,14 +40,21 @@ export var BlockTypeButton = function BlockTypeButton(props) {
37
40
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
38
41
  css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
39
42
  "data-testid": "toolbar-block-type-text-styles-icon"
40
- }, props.isSmall && jsx(TextStyleIcon, {
43
+ }, fg('platform_editor_migration_icon_and_typography') ? jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIcon, {
44
+ label: labelTextStyles,
45
+ spacing: "spacious",
46
+ color: "currentColor"
47
+ }), jsx(ChevronDownIcon, {
48
+ label: "",
49
+ color: "currentColor"
50
+ })) : jsx(React.Fragment, null, props.isSmall && jsx(TextStyleIconLegacy, {
41
51
  label: labelTextStyles
42
52
  }), jsx("span", {
43
53
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
44
54
  css: expandIconWrapperStyle
45
55
  }, jsx(ExpandIcon, {
46
56
  label: ""
47
- })))
57
+ }))))
48
58
  }, !props.isSmall && jsx("span", {
49
59
  css: [
50
60
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "3.10.1",
3
+ "version": "3.11.0",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,13 +36,14 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/adf-schema": "^40.3.0",
39
- "@atlaskit/editor-common": "^87.0.0",
39
+ "@atlaskit/editor-common": "^87.3.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
41
- "@atlaskit/editor-plugin-primary-toolbar": "^1.3.0",
41
+ "@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
42
42
  "@atlaskit/editor-prosemirror": "5.0.1",
43
43
  "@atlaskit/editor-shared-styles": "^2.13.0",
44
44
  "@atlaskit/editor-tables": "^2.8.0",
45
- "@atlaskit/icon": "^22.7.0",
45
+ "@atlaskit/icon": "^22.9.0",
46
+ "@atlaskit/platform-feature-flags": "^0.3.0",
46
47
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
47
48
  "@atlaskit/theme": "^12.11.0",
48
49
  "@atlaskit/tokens": "^1.56.0",
@@ -99,5 +100,10 @@
99
100
  "import-no-extraneous-disable-for-examples-and-docs"
100
101
  ]
101
102
  }
103
+ },
104
+ "platform-feature-flags": {
105
+ "platform_editor_migration_icon_and_typography": {
106
+ "type": "boolean"
107
+ }
102
108
  }
103
109
  }