@atlaskit/editor-plugin-block-type 5.2.4 → 5.2.6

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,22 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 5.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#180492](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180492)
8
+ [`2341110d5c5a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2341110d5c5a1) -
9
+ Clean up platform_editor_comments_toolbar_responsiveness
10
+
11
+ ## 5.2.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [#176627](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/176627)
16
+ [`fe6d06a268e3b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe6d06a268e3b) -
17
+ Add support for future versions for react-intl
18
+ - Updated dependencies
19
+
3
20
  ## 5.2.4
4
21
 
5
22
  ### Patch Changes
@@ -47,7 +47,7 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
47
47
  color: "currentColor",
48
48
  LEGACY_fallbackIcon: _textStyle.default
49
49
  });
50
- var chevronIconSpacing = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') || !props.isSmall && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
50
+ var chevronIconSpacing = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
51
51
  var shouldUseIconAsButton = props.isSmall || (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_13');
52
52
  return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
53
53
  spacing: props.isReducedSpacing ? 'none' : 'default',
@@ -20,13 +20,11 @@ var _styles = require("@atlaskit/editor-common/styles");
20
20
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
21
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
22
  var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
23
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
23
  var _primitives = require("@atlaskit/primitives");
25
24
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
26
25
  var _tokens = require("@atlaskit/tokens");
27
26
  var _blockTypes = require("../../block-types");
28
27
  var _blocktypeButton = require("./blocktype-button");
29
- var _icons = require("./icons");
30
28
  var _styled = require("./styled");
31
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
32
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -85,8 +83,12 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
85
83
  var isActive = currentBlockType === blockType;
86
84
  var tagName = blockType.tagName || 'p';
87
85
  var Tag = tagName;
88
- var keyMap = (0, _keymaps.findKeymapByDescription)(blockType.title.defaultMessage);
89
- var icon = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : blockType.LEGACY_icon;
86
+ var defaultMessage = Array.isArray(blockType.title.defaultMessage) ? blockType.title.defaultMessage.find(function (message) {
87
+ return 'value' in message;
88
+ }) : blockType.title.defaultMessage;
89
+ var description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
90
+ var keyMap = (0, _keymaps.findKeymapByDescription)(description);
91
+ var icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
90
92
  var item = {
91
93
  content:
92
94
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -215,10 +217,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
215
217
  }).map(function (blockType) {
216
218
  return blockType.title;
217
219
  });
218
- var defaultIcon = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') ? (0, _react2.jsx)(_text.default, {
220
+ var defaultIcon = (0, _react2.jsx)(_text.default, {
219
221
  label: ""
220
- }) : (0, _react2.jsx)(_icons.Text, null);
221
- var currentIcon = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4') ? currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon : currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.LEGACY_icon;
222
+ });
223
+ var currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
222
224
  if (!this.props.isDisabled && !blockTypesDisabled) {
223
225
  var items = this.createItems();
224
226
  var button = (0, _react2.jsx)(_blocktypeButton.BlockTypeButton, {
@@ -266,11 +268,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
266
268
  }
267
269
  return isOpenedByKeyboard;
268
270
  }
269
- }, (0, _platformFeatureFlags.fg)('platform_editor_comments_toolbar_responsiveness') ?
270
- // extra wrapper added to prevent flex shrinking of the button
271
- (0, _react2.jsx)(_primitives.Box, {
271
+ }, (0, _react2.jsx)(_primitives.Box, {
272
272
  xcss: buttonWrapperStyles
273
- }, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _react2.jsx)("span", {
273
+ }, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _react2.jsx)("span", {
274
274
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
275
275
  css: _styles.separatorStyles
276
276
  }));
@@ -39,7 +39,7 @@ export const BlockTypeButton = props => {
39
39
  color: "currentColor",
40
40
  LEGACY_fallbackIcon: TextStyleIconLegacy
41
41
  });
42
- const chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall && fg('platform_editor_controls_patch_4') || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
42
+ const chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
43
43
  const shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13');
44
44
  return jsx(ToolbarButton, {
45
45
  spacing: props.isReducedSpacing ? 'none' : 'default',
@@ -14,13 +14,11 @@ import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
14
14
  import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
15
15
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
16
16
  import TextIcon from '@atlaskit/icon/core/text';
17
- import { fg } from '@atlaskit/platform-feature-flags';
18
17
  import { Box, xcss } from '@atlaskit/primitives';
19
18
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
20
19
  import { ThemeMutationObserver } from '@atlaskit/tokens';
21
20
  import { NORMAL_TEXT } from '../../block-types';
22
21
  import { BlockTypeButton } from './blocktype-button';
23
- import { Text } from './icons';
24
22
  import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
25
23
  const buttonWrapperStyles = xcss({
26
24
  flexShrink: 0
@@ -71,8 +69,10 @@ class ToolbarBlockType extends React.PureComponent {
71
69
  const isActive = currentBlockType === blockType;
72
70
  const tagName = blockType.tagName || 'p';
73
71
  const Tag = tagName;
74
- const keyMap = findKeymapByDescription(blockType.title.defaultMessage);
75
- const icon = fg('platform_editor_controls_patch_4') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : blockType.LEGACY_icon;
72
+ const defaultMessage = Array.isArray(blockType.title.defaultMessage) ? blockType.title.defaultMessage.find(message => 'value' in message) : blockType.title.defaultMessage;
73
+ const description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
74
+ const keyMap = findKeymapByDescription(description);
75
+ const icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
76
76
  const item = {
77
77
  content:
78
78
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -187,10 +187,10 @@ class ToolbarBlockType extends React.PureComponent {
187
187
  return null;
188
188
  }
189
189
  const blockTypeTitles = availableBlockTypesInDropdown.filter(blockType => blockType.name === (currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.name)).map(blockType => blockType.title);
190
- const defaultIcon = fg('platform_editor_controls_patch_4') ? jsx(TextIcon, {
190
+ const defaultIcon = jsx(TextIcon, {
191
191
  label: ""
192
- }) : jsx(Text, null);
193
- const currentIcon = fg('platform_editor_controls_patch_4') ? currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon : currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.LEGACY_icon;
192
+ });
193
+ const currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
194
194
  if (!this.props.isDisabled && !blockTypesDisabled) {
195
195
  const items = this.createItems();
196
196
  const button = jsx(BlockTypeButton, {
@@ -239,11 +239,9 @@ class ToolbarBlockType extends React.PureComponent {
239
239
  }
240
240
  return isOpenedByKeyboard;
241
241
  }
242
- }, fg('platform_editor_comments_toolbar_responsiveness') ?
243
- // extra wrapper added to prevent flex shrinking of the button
244
- jsx(Box, {
242
+ }, jsx(Box, {
245
243
  xcss: buttonWrapperStyles
246
- }, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
244
+ }, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
247
245
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
248
246
  css: separatorStyles
249
247
  }));
@@ -39,7 +39,7 @@ export var BlockTypeButton = function BlockTypeButton(props) {
39
39
  color: "currentColor",
40
40
  LEGACY_fallbackIcon: TextStyleIconLegacy
41
41
  });
42
- var chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall && fg('platform_editor_controls_patch_4') || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
42
+ var chevronIconSpacing = expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && (props.isSmall || !props.isSmall && fg('platform_editor_controls_patch_13')) ? 'spacious' : 'none';
43
43
  var shouldUseIconAsButton = props.isSmall || expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') && fg('platform_editor_controls_patch_13');
44
44
  return jsx(ToolbarButton, {
45
45
  spacing: props.isReducedSpacing ? 'none' : 'default',
@@ -23,13 +23,11 @@ import { separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
23
23
  import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
24
24
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
25
25
  import TextIcon from '@atlaskit/icon/core/text';
26
- import { fg } from '@atlaskit/platform-feature-flags';
27
26
  import { Box, xcss } from '@atlaskit/primitives';
28
27
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
29
28
  import { ThemeMutationObserver } from '@atlaskit/tokens';
30
29
  import { NORMAL_TEXT } from '../../block-types';
31
30
  import { BlockTypeButton } from './blocktype-button';
32
- import { Text } from './icons';
33
31
  import { blockTypeMenuItemStyle, floatingToolbarWrapperStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
34
32
  var buttonWrapperStyles = xcss({
35
33
  flexShrink: 0
@@ -81,8 +79,12 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
81
79
  var isActive = currentBlockType === blockType;
82
80
  var tagName = blockType.tagName || 'p';
83
81
  var Tag = tagName;
84
- var keyMap = findKeymapByDescription(blockType.title.defaultMessage);
85
- var icon = fg('platform_editor_controls_patch_4') ? blockType === null || blockType === void 0 ? void 0 : blockType.icon : blockType.LEGACY_icon;
82
+ var defaultMessage = Array.isArray(blockType.title.defaultMessage) ? blockType.title.defaultMessage.find(function (message) {
83
+ return 'value' in message;
84
+ }) : blockType.title.defaultMessage;
85
+ var description = typeof defaultMessage === 'string' ? defaultMessage : defaultMessage && 'value' in defaultMessage ? defaultMessage.value : '';
86
+ var keyMap = findKeymapByDescription(description);
87
+ var icon = blockType === null || blockType === void 0 ? void 0 : blockType.icon;
86
88
  var item = {
87
89
  content:
88
90
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -211,10 +213,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
211
213
  }).map(function (blockType) {
212
214
  return blockType.title;
213
215
  });
214
- var defaultIcon = fg('platform_editor_controls_patch_4') ? jsx(TextIcon, {
216
+ var defaultIcon = jsx(TextIcon, {
215
217
  label: ""
216
- }) : jsx(Text, null);
217
- var currentIcon = fg('platform_editor_controls_patch_4') ? currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon : currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.LEGACY_icon;
218
+ });
219
+ var currentIcon = currentBlockType === null || currentBlockType === void 0 ? void 0 : currentBlockType.icon;
218
220
  if (!this.props.isDisabled && !blockTypesDisabled) {
219
221
  var items = this.createItems();
220
222
  var button = jsx(BlockTypeButton, {
@@ -262,11 +264,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
262
264
  }
263
265
  return isOpenedByKeyboard;
264
266
  }
265
- }, fg('platform_editor_comments_toolbar_responsiveness') ?
266
- // extra wrapper added to prevent flex shrinking of the button
267
- jsx(Box, {
267
+ }, jsx(Box, {
268
268
  xcss: buttonWrapperStyles
269
- }, button) : button), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
269
+ }, button)), !(api !== null && api !== void 0 && api.primaryToolbar) && jsx("span", {
270
270
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
271
271
  css: separatorStyles
272
272
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "5.2.4",
3
+ "version": "5.2.6",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: Lego",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -36,20 +35,20 @@
36
35
  },
37
36
  "dependencies": {
38
37
  "@atlaskit/adf-schema": "^47.6.0",
39
- "@atlaskit/editor-common": "^107.1.0",
38
+ "@atlaskit/editor-common": "^107.4.0",
40
39
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
41
40
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
42
- "@atlaskit/editor-plugin-selection-toolbar": "^3.7.0",
41
+ "@atlaskit/editor-plugin-selection-toolbar": "^3.8.0",
43
42
  "@atlaskit/editor-prosemirror": "7.0.0",
44
43
  "@atlaskit/editor-shared-styles": "^3.4.0",
45
44
  "@atlaskit/editor-tables": "^2.9.0",
46
- "@atlaskit/icon": "^27.1.0",
47
- "@atlaskit/icon-lab": "^5.0.0",
45
+ "@atlaskit/icon": "^27.2.0",
46
+ "@atlaskit/icon-lab": "^5.1.0",
48
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/primitives": "^14.9.0",
48
+ "@atlaskit/primitives": "^14.10.0",
50
49
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
51
50
  "@atlaskit/theme": "^18.0.0",
52
- "@atlaskit/tmp-editor-statsig": "^8.0.0",
51
+ "@atlaskit/tmp-editor-statsig": "^8.6.0",
53
52
  "@atlaskit/tokens": "^5.4.0",
54
53
  "@babel/runtime": "^7.0.0",
55
54
  "@emotion/react": "^11.7.1"
@@ -117,14 +116,8 @@
117
116
  "platform_editor_controls_patch_13": {
118
117
  "type": "boolean"
119
118
  },
120
- "platform_editor_comments_toolbar_responsiveness": {
121
- "type": "boolean"
122
- },
123
119
  "platform_editor_use_preferences_plugin": {
124
120
  "type": "boolean"
125
- },
126
- "platform_editor_controls_patch_4": {
127
- "type": "boolean"
128
121
  }
129
122
  }
130
123
  }