@atlaskit/editor-plugin-text-formatting 6.0.1 → 6.0.3

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,21 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 6.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2f81c0f3bf21d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f81c0f3bf21d) -
8
+ [ux] ED-29318 [CR-6b] Add new toolbar icons to comment editor
9
+ - Updated dependencies
10
+
11
+ ## 6.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`20c74a7647d3e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20c74a7647d3e) -
16
+ [ux] ED-29274 Add missing tooltip for toolbar buttons
17
+ - Updated dependencies
18
+
3
19
  ## 6.0.1
4
20
 
5
21
  ### Patch Changes
@@ -12,6 +12,7 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
13
  var _toolbar = require("@atlaskit/editor-common/toolbar");
14
14
  var _editorToolbar = require("@atlaskit/editor-toolbar");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  var _clearFormatting = require("../../../editor-commands/clear-formatting");
16
17
  var _utils = require("./utils");
17
18
  var FormatMenuItem = exports.FormatMenuItem = function FormatMenuItem(_ref) {
@@ -134,7 +135,15 @@ var MoreFormattingMenu = exports.MoreFormattingMenu = function MoreFormattingMen
134
135
  var _useIntl2 = (0, _reactIntlNext.useIntl)(),
135
136
  formatMessage = _useIntl2.formatMessage;
136
137
  var content = formatMessage(_messages.toolbarMessages.moreFormatting);
137
- return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
138
+ return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
139
+ content: formatMessage(_messages.toolbarMessages.textFormat)
140
+ }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
141
+ iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.MoreItemsIcon, {
142
+ label: "",
143
+ testId: "more-formatting"
144
+ }),
145
+ label: content
146
+ }, children)) : /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
138
147
  iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.MoreItemsIcon, {
139
148
  label: "",
140
149
  testId: "more-formatting"
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.textFormattingMenuGroup = void 0;
7
+ exports.textFormattingMenuGroup = exports.getFormatMenuItems = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireDefault(require("react"));
@@ -13,7 +13,7 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
13
13
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
14
  var _Component = require("./Component");
15
15
  var _utils = require("./utils");
16
- var getFormatMenuItems = function getFormatMenuItems(api) {
16
+ var getFormatMenuItems = exports.getFormatMenuItems = function getFormatMenuItems(api) {
17
17
  return Object.entries((0, _utils.formatOptions)()).map(function (_ref) {
18
18
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
19
19
  optionType = _ref2[0],
@@ -77,7 +77,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
77
77
  rank: _toolbar.TEXT_COLLAPSED_MENU_RANK[_toolbar.TEXT_FORMATTING_MENU_SECTION.key]
78
78
  }] : [])),
79
79
  component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? _Component.MenuSection : undefined
80
- }, {
80
+ }].concat((0, _toConsumableArray2.default)((0, _TextFormattingMenuGroup.getFormatMenuItems)(api)), [{
81
81
  type: _toolbar.CLEAR_FORMARTTING_MENU_SECTION.type,
82
82
  key: _toolbar.CLEAR_FORMARTTING_MENU_SECTION.key,
83
83
  parents: [{
@@ -110,7 +110,7 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
110
110
  api: api
111
111
  }));
112
112
  }
113
- }];
113
+ }]);
114
114
  };
115
115
  var getToolbarComponentsResponsivenessUpdate = exports.getToolbarComponentsResponsivenessUpdate = function getToolbarComponentsResponsivenessUpdate(api) {
116
116
  return [].concat((0, _toConsumableArray2.default)((0, _TextFormattingGroups.textFormattingGroupForPrimaryToolbar)(api)), (0, _toConsumableArray2.default)((0, _TextFormattingGroupForInlineToolbar.textFormattingGroupForInlineToolbar)(api)), (0, _toConsumableArray2.default)((0, _BoldButtonGroup.boldButtonGroup)(api)), (0, _toConsumableArray2.default)((0, _UnderlineButtonGroup.underlineButtonGroup)(api)), (0, _toConsumableArray2.default)((0, _TextFormattingMenuGroup.textFormattingMenuGroup)(api)));
@@ -5,6 +5,7 @@ import { ToolTipContent, clearFormatting, getAriaKeyshortcuts, tooltip } from '@
5
5
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
6
6
  import { getInputMethodFromParentKeys, TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar';
7
7
  import { ToolbarButton, ToolbarDropdownItem, ClearFormattingIcon, ToolbarKeyboardShortcutHint, ToolbarDropdownMenu, MoreItemsIcon, ToolbarTooltip, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { clearFormattingWithAnalyticsNext } from '../../../editor-commands/clear-formatting';
9
10
  import { useComponentInfo } from './utils';
10
11
  export const FormatMenuItem = ({
@@ -136,7 +137,15 @@ export const MoreFormattingMenu = ({
136
137
  formatMessage
137
138
  } = useIntl();
138
139
  const content = formatMessage(toolbarMessages.moreFormatting);
139
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
140
+ return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolbarTooltip, {
141
+ content: formatMessage(toolbarMessages.textFormat)
142
+ }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
143
+ iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
144
+ label: "",
145
+ testId: "more-formatting"
146
+ }),
147
+ label: content
148
+ }, children)) : /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
140
149
  iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
141
150
  label: "",
142
151
  testId: "more-formatting"
@@ -4,7 +4,7 @@ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
4
4
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
5
  import { ClearFormatMenuItem, MoreFormattingMenu, MenuSection, FormatMenuItem } from './Component';
6
6
  import { formatOptions } from './utils';
7
- const getFormatMenuItems = api => {
7
+ export const getFormatMenuItems = api => {
8
8
  return Object.entries(formatOptions()).map(([optionType, {
9
9
  icon,
10
10
  shortcut,
@@ -6,7 +6,7 @@ import { boldButtonGroup } from './Toolbar/components/BoldButtonGroup';
6
6
  import { FormatButton, ClearFormatMenuItem, MoreFormattingMenu, MenuSection } from './Toolbar/components/Component';
7
7
  import { textFormattingGroupForInlineToolbar } from './Toolbar/components/TextFormattingGroupForInlineToolbar';
8
8
  import { textFormattingGroupForPrimaryToolbar } from './Toolbar/components/TextFormattingGroups';
9
- import { textFormattingMenuGroup } from './Toolbar/components/TextFormattingMenuGroup';
9
+ import { textFormattingMenuGroup, getFormatMenuItems } from './Toolbar/components/TextFormattingMenuGroup';
10
10
  import { underlineButtonGroup } from './Toolbar/components/UnderlineButtonGroup';
11
11
  import { formatOptions } from './Toolbar/components/utils';
12
12
  import { FormatOptions } from './Toolbar/types';
@@ -71,7 +71,7 @@ export const getToolbarComponents = api => expValEquals('platform_editor_toolbar
71
71
  rank: TEXT_COLLAPSED_MENU_RANK[TEXT_FORMATTING_MENU_SECTION.key]
72
72
  }] : [])],
73
73
  component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? MenuSection : undefined
74
- }, {
74
+ }, ...getFormatMenuItems(api), {
75
75
  type: CLEAR_FORMARTTING_MENU_SECTION.type,
76
76
  key: CLEAR_FORMARTTING_MENU_SECTION.key,
77
77
  parents: [{
@@ -5,6 +5,7 @@ import { ToolTipContent, clearFormatting, getAriaKeyshortcuts, tooltip } from '@
5
5
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
6
6
  import { getInputMethodFromParentKeys, TEXT_COLLAPSED_MENU } from '@atlaskit/editor-common/toolbar';
7
7
  import { ToolbarButton, ToolbarDropdownItem, ClearFormattingIcon, ToolbarKeyboardShortcutHint, ToolbarDropdownMenu, MoreItemsIcon, ToolbarTooltip, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { clearFormattingWithAnalyticsNext } from '../../../editor-commands/clear-formatting';
9
10
  import { useComponentInfo } from './utils';
10
11
  export var FormatMenuItem = function FormatMenuItem(_ref) {
@@ -127,7 +128,15 @@ export var MoreFormattingMenu = function MoreFormattingMenu(_ref4) {
127
128
  var _useIntl2 = useIntl(),
128
129
  formatMessage = _useIntl2.formatMessage;
129
130
  var content = formatMessage(toolbarMessages.moreFormatting);
130
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
131
+ return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ToolbarTooltip, {
132
+ content: formatMessage(toolbarMessages.textFormat)
133
+ }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
134
+ iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
135
+ label: "",
136
+ testId: "more-formatting"
137
+ }),
138
+ label: content
139
+ }, children)) : /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
131
140
  iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
132
141
  label: "",
133
142
  testId: "more-formatting"
@@ -6,7 +6,7 @@ import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
6
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
7
  import { ClearFormatMenuItem, MoreFormattingMenu, MenuSection, FormatMenuItem } from './Component';
8
8
  import { formatOptions } from './utils';
9
- var getFormatMenuItems = function getFormatMenuItems(api) {
9
+ export var getFormatMenuItems = function getFormatMenuItems(api) {
10
10
  return Object.entries(formatOptions()).map(function (_ref) {
11
11
  var _ref2 = _slicedToArray(_ref, 2),
12
12
  optionType = _ref2[0],
@@ -7,7 +7,7 @@ import { boldButtonGroup } from './Toolbar/components/BoldButtonGroup';
7
7
  import { FormatButton, ClearFormatMenuItem, MoreFormattingMenu, MenuSection } from './Toolbar/components/Component';
8
8
  import { textFormattingGroupForInlineToolbar } from './Toolbar/components/TextFormattingGroupForInlineToolbar';
9
9
  import { textFormattingGroupForPrimaryToolbar } from './Toolbar/components/TextFormattingGroups';
10
- import { textFormattingMenuGroup } from './Toolbar/components/TextFormattingMenuGroup';
10
+ import { textFormattingMenuGroup, getFormatMenuItems } from './Toolbar/components/TextFormattingMenuGroup';
11
11
  import { underlineButtonGroup } from './Toolbar/components/UnderlineButtonGroup';
12
12
  import { formatOptions } from './Toolbar/components/utils';
13
13
  import { FormatOptions } from './Toolbar/types';
@@ -70,7 +70,7 @@ export var getToolbarComponents = function getToolbarComponents(api) {
70
70
  rank: TEXT_COLLAPSED_MENU_RANK[TEXT_FORMATTING_MENU_SECTION.key]
71
71
  }] : [])),
72
72
  component: expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? MenuSection : undefined
73
- }, {
73
+ }].concat(_toConsumableArray(getFormatMenuItems(api)), [{
74
74
  type: CLEAR_FORMARTTING_MENU_SECTION.type,
75
75
  key: CLEAR_FORMARTTING_MENU_SECTION.key,
76
76
  parents: [{
@@ -103,7 +103,7 @@ export var getToolbarComponents = function getToolbarComponents(api) {
103
103
  api: api
104
104
  }));
105
105
  }
106
- }];
106
+ }]);
107
107
  };
108
108
  export var getToolbarComponentsResponsivenessUpdate = function getToolbarComponentsResponsivenessUpdate(api) {
109
109
  return [].concat(_toConsumableArray(textFormattingGroupForPrimaryToolbar(api)), _toConsumableArray(textFormattingGroupForInlineToolbar(api)), _toConsumableArray(boldButtonGroup(api)), _toConsumableArray(underlineButtonGroup(api)), _toConsumableArray(textFormattingMenuGroup(api)));
@@ -1,4 +1,5 @@
1
1
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type RegisterComponent } from '@atlaskit/editor-toolbar-model';
3
3
  import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
4
+ export declare const getFormatMenuItems: (api?: ExtractInjectionAPI<TextFormattingPlugin>) => RegisterComponent[];
4
5
  export declare const textFormattingMenuGroup: (api?: ExtractInjectionAPI<TextFormattingPlugin>) => RegisterComponent[];
@@ -1,4 +1,5 @@
1
1
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type RegisterComponent } from '@atlaskit/editor-toolbar-model';
3
3
  import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
4
+ export declare const getFormatMenuItems: (api?: ExtractInjectionAPI<TextFormattingPlugin>) => RegisterComponent[];
4
5
  export declare const textFormattingMenuGroup: (api?: ExtractInjectionAPI<TextFormattingPlugin>) => RegisterComponent[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
32
  "@atlaskit/adf-schema": "^51.2.0",
33
- "@atlaskit/editor-plugin-analytics": "^6.0.0",
33
+ "@atlaskit/editor-plugin-analytics": "^6.1.0",
34
34
  "@atlaskit/editor-plugin-base": "^7.0.0",
35
35
  "@atlaskit/editor-plugin-primary-toolbar": "^7.0.0",
36
36
  "@atlaskit/editor-plugin-selection-toolbar": "^7.0.0",
@@ -43,14 +43,14 @@
43
43
  "@atlaskit/icon": "^28.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
46
- "@atlaskit/tmp-editor-statsig": "^12.32.0",
47
- "@atlaskit/tokens": "^6.3.0",
46
+ "@atlaskit/tmp-editor-statsig": "^12.33.0",
47
+ "@atlaskit/tokens": "^6.4.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
50
50
  "react-intl-next": "npm:react-intl@^5.18.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^110.1.0",
53
+ "@atlaskit/editor-common": "^110.4.0",
54
54
  "react": "^18.2.0"
55
55
  },
56
56
  "devDependencies": {