@atlaskit/editor-plugin-text-formatting 3.0.10 → 3.0.12

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,23 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 3.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f22ce89845e1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f22ce89845e1e) -
8
+ [ED-28686] Switch to use utility getInputMethodFromParentKeys
9
+ - Updated dependencies
10
+
11
+ ## 3.0.11
12
+
13
+ ### Patch Changes
14
+
15
+ - [#199487](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199487)
16
+ [`54098ba4cc83c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/54098ba4cc83c) -
17
+ Add LinkSection and TextSection and add logic to hide them when toolbar is pinned. Add
18
+ UserPreferencesPlugin and EditorViewModePlugin as a dependency to editor-plugin-toolbar.
19
+ - Updated dependencies
20
+
3
21
  ## 3.0.10
4
22
 
5
23
  ### Patch Changes
@@ -10,6 +10,7 @@ var _reactIntlNext = require("react-intl-next");
10
10
  var _hooks = require("@atlaskit/editor-common/hooks");
11
11
  var _keymaps = require("@atlaskit/editor-common/keymaps");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
+ var _toolbar = require("@atlaskit/editor-common/toolbar");
13
14
  var _editorToolbar = require("@atlaskit/editor-toolbar");
14
15
  var _clearFormatting = require("../../../editor-commands/clear-formatting");
15
16
  var _utils = require("./utils");
@@ -114,10 +115,9 @@ var ClearFormatMenuItem = exports.ClearFormatMenuItem = function ClearFormatMenu
114
115
  }
115
116
  var formatTitle = formatMessage(_messages.toolbarMessages.clearFormatting);
116
117
  var shortcutContent = (0, _keymaps.tooltip)(_keymaps.clearFormatting);
117
- var ariaLabel = (0, _keymaps.tooltip)(_keymaps.clearFormatting, formatTitle);
118
118
  var onClick = function onClick() {
119
119
  var _api$analytics;
120
- api === null || api === void 0 || api.core.actions.execute((0, _clearFormatting.clearFormattingWithAnalyticsNext)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)((0, _utils.getInputMethodFromParentKeys)(parents)));
120
+ api === null || api === void 0 || api.core.actions.execute((0, _clearFormatting.clearFormattingWithAnalyticsNext)(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)((0, _toolbar.getInputMethodFromParentKeys)(parents)));
121
121
  };
122
122
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
123
123
  elemBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.ClearFormattingIcon, {
@@ -128,8 +128,7 @@ var ClearFormatMenuItem = exports.ClearFormatMenuItem = function ClearFormatMenu
128
128
  }),
129
129
  isDisabled: !isFormattingPresent,
130
130
  onClick: onClick,
131
- "aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.clearFormatting),
132
- "aria-label": ariaLabel
131
+ ariaKeyshortcuts: (0, _keymaps.getAriaKeyshortcuts)(_keymaps.clearFormatting)
133
132
  }, formatTitle);
134
133
  };
135
134
  var MoreFormattingMenu = exports.MoreFormattingMenu = function MoreFormattingMenu(_ref4) {
@@ -140,9 +139,10 @@ var MoreFormattingMenu = exports.MoreFormattingMenu = function MoreFormattingMen
140
139
  var content = formatMessage(_messages.toolbarMessages.moreFormatting);
141
140
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
142
141
  iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.MoreItemsIcon, {
143
- label: content,
142
+ label: "",
144
143
  testId: "more-formatting"
145
144
  }),
146
- groupLocation: groupLocation
145
+ groupLocation: groupLocation,
146
+ label: content
147
147
  }, children);
148
148
  };
@@ -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.useComponentInfo = exports.getInputMethodFromParentKeys = exports.formatOptions = void 0;
7
+ exports.useComponentInfo = exports.formatOptions = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _hooks = require("@atlaskit/editor-common/hooks");
@@ -13,14 +13,8 @@ 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
15
  var _toggleMark = require("../../../editor-commands/toggle-mark");
16
- var _inputMethodUtils = require("../input-method-utils");
17
- var _types = require("../types");
18
16
  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; }
19
17
  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; }
20
- var getInputMethodFromParentKeys = exports.getInputMethodFromParentKeys = function getInputMethodFromParentKeys(parentKeys) {
21
- var _parentKeys$at;
22
- return (0, _inputMethodUtils.getInputMethod)(((_parentKeys$at = parentKeys.at(-1)) === null || _parentKeys$at === void 0 ? void 0 : _parentKeys$at.key) === _toolbar.TOOLBARS.INLINE_TEXT_TOOLBAR ? _types.ToolbarType.FLOATING : _types.ToolbarType.PRIMARY);
23
- };
24
18
  var FormatMarkSchema = {
25
19
  strong: 'strong',
26
20
  em: 'em',
@@ -73,7 +67,7 @@ var useComponentInfo = exports.useComponentInfo = function useComponentInfo(_ref
73
67
  var ariaLabel = (0, _keymaps.tooltip)(shortcut, formatTitle);
74
68
  var onClick = function onClick() {
75
69
  var _api$analytics;
76
- api === null || api === void 0 || api.core.actions.execute(toggleMarkWithAnalyticsCallback(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(getInputMethodFromParentKeys(parents)));
70
+ api === null || api === void 0 || api.core.actions.execute(toggleMarkWithAnalyticsCallback(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)((0, _toolbar.getInputMethodFromParentKeys)(parents)));
77
71
  };
78
72
  return _objectSpread(_objectSpread({}, formatOptionState), {}, {
79
73
  formatTitle: formatTitle,
@@ -3,9 +3,10 @@ import { useIntl } from 'react-intl-next';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { clearFormatting, getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
6
+ import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
6
7
  import { ToolbarButton, ToolbarDropdownItem, ClearFormattingIcon, ToolbarKeyboardShortcutHint, ToolbarDropdownMenu, MoreItemsIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
7
8
  import { clearFormattingWithAnalyticsNext } from '../../../editor-commands/clear-formatting';
8
- import { getInputMethodFromParentKeys, useComponentInfo } from './utils';
9
+ import { useComponentInfo } from './utils';
9
10
  export const FormatMenuItem = ({
10
11
  parents,
11
12
  api,
@@ -113,7 +114,6 @@ export const ClearFormatMenuItem = ({
113
114
  }
114
115
  const formatTitle = formatMessage(toolbarMessages.clearFormatting);
115
116
  const shortcutContent = tooltip(clearFormatting);
116
- const ariaLabel = tooltip(clearFormatting, formatTitle);
117
117
  const onClick = () => {
118
118
  var _api$analytics;
119
119
  api === null || api === void 0 ? void 0 : api.core.actions.execute(clearFormattingWithAnalyticsNext(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(getInputMethodFromParentKeys(parents)));
@@ -127,8 +127,7 @@ export const ClearFormatMenuItem = ({
127
127
  }),
128
128
  isDisabled: !isFormattingPresent,
129
129
  onClick: onClick,
130
- "aria-keyshortcuts": getAriaKeyshortcuts(clearFormatting),
131
- "aria-label": ariaLabel
130
+ ariaKeyshortcuts: getAriaKeyshortcuts(clearFormatting)
132
131
  }, formatTitle);
133
132
  };
134
133
  export const MoreFormattingMenu = ({
@@ -141,9 +140,10 @@ export const MoreFormattingMenu = ({
141
140
  const content = formatMessage(toolbarMessages.moreFormatting);
142
141
  return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
143
142
  iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
144
- label: content,
143
+ label: "",
145
144
  testId: "more-formatting"
146
145
  }),
147
- groupLocation: groupLocation
146
+ groupLocation: groupLocation,
147
+ label: content
148
148
  }, children);
149
149
  };
@@ -2,15 +2,9 @@ import { useIntl } from 'react-intl-next';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline, tooltip } from '@atlaskit/editor-common/keymaps';
4
4
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
5
- import { BOLD_MENU_ITEM, CODE_MENU_ITEM, ITALIC_MENU_ITEM, STRIKE_MENU_ITEM, SUBSCRIPT_MENU_ITEM, SUPERSCRIPT_MENU_ITEM, TEXT_FORMATTING_MENU_SECTION_RANK, TOOLBARS, UNDERLINE_MENU_ITEM } from '@atlaskit/editor-common/toolbar';
5
+ import { BOLD_MENU_ITEM, CODE_MENU_ITEM, ITALIC_MENU_ITEM, STRIKE_MENU_ITEM, SUBSCRIPT_MENU_ITEM, SUPERSCRIPT_MENU_ITEM, TEXT_FORMATTING_MENU_SECTION_RANK, UNDERLINE_MENU_ITEM, getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
6
6
  import { BoldIcon, ItalicIcon, UnderlineIcon, CodeIcon, StrikeThroughIcon, SubscriptIcon, SuperscriptIcon } from '@atlaskit/editor-toolbar';
7
7
  import { toggleStrongWithAnalytics, toggleEmWithAnalytics, toggleUnderlineWithAnalytics, toggleCodeWithAnalytics, toggleStrikeWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics } from '../../../editor-commands/toggle-mark';
8
- import { getInputMethod } from '../input-method-utils';
9
- import { ToolbarType } from '../types';
10
- export const getInputMethodFromParentKeys = parentKeys => {
11
- var _parentKeys$at;
12
- return getInputMethod(((_parentKeys$at = parentKeys.at(-1)) === null || _parentKeys$at === void 0 ? void 0 : _parentKeys$at.key) === TOOLBARS.INLINE_TEXT_TOOLBAR ? ToolbarType.FLOATING : ToolbarType.PRIMARY);
13
- };
14
8
  const FormatMarkSchema = {
15
9
  strong: 'strong',
16
10
  em: 'em',
@@ -3,9 +3,10 @@ import { useIntl } from 'react-intl-next';
3
3
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
4
4
  import { clearFormatting, getAriaKeyshortcuts, tooltip } from '@atlaskit/editor-common/keymaps';
5
5
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
6
+ import { getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
6
7
  import { ToolbarButton, ToolbarDropdownItem, ClearFormattingIcon, ToolbarKeyboardShortcutHint, ToolbarDropdownMenu, MoreItemsIcon, ToolbarTooltip } from '@atlaskit/editor-toolbar';
7
8
  import { clearFormattingWithAnalyticsNext } from '../../../editor-commands/clear-formatting';
8
- import { getInputMethodFromParentKeys, useComponentInfo } from './utils';
9
+ import { useComponentInfo } from './utils';
9
10
  export var FormatMenuItem = function FormatMenuItem(_ref) {
10
11
  var parents = _ref.parents,
11
12
  api = _ref.api,
@@ -107,7 +108,6 @@ export var ClearFormatMenuItem = function ClearFormatMenuItem(_ref3) {
107
108
  }
108
109
  var formatTitle = formatMessage(toolbarMessages.clearFormatting);
109
110
  var shortcutContent = tooltip(clearFormatting);
110
- var ariaLabel = tooltip(clearFormatting, formatTitle);
111
111
  var onClick = function onClick() {
112
112
  var _api$analytics;
113
113
  api === null || api === void 0 || api.core.actions.execute(clearFormattingWithAnalyticsNext(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(getInputMethodFromParentKeys(parents)));
@@ -121,8 +121,7 @@ export var ClearFormatMenuItem = function ClearFormatMenuItem(_ref3) {
121
121
  }),
122
122
  isDisabled: !isFormattingPresent,
123
123
  onClick: onClick,
124
- "aria-keyshortcuts": getAriaKeyshortcuts(clearFormatting),
125
- "aria-label": ariaLabel
124
+ ariaKeyshortcuts: getAriaKeyshortcuts(clearFormatting)
126
125
  }, formatTitle);
127
126
  };
128
127
  export var MoreFormattingMenu = function MoreFormattingMenu(_ref4) {
@@ -133,9 +132,10 @@ export var MoreFormattingMenu = function MoreFormattingMenu(_ref4) {
133
132
  var content = formatMessage(toolbarMessages.moreFormatting);
134
133
  return /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
135
134
  iconBefore: /*#__PURE__*/React.createElement(MoreItemsIcon, {
136
- label: content,
135
+ label: "",
137
136
  testId: "more-formatting"
138
137
  }),
139
- groupLocation: groupLocation
138
+ groupLocation: groupLocation,
139
+ label: content
140
140
  }, children);
141
141
  };
@@ -5,15 +5,9 @@ import { useIntl } from 'react-intl-next';
5
5
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
6
6
  import { toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline, tooltip } from '@atlaskit/editor-common/keymaps';
7
7
  import { toolbarMessages } from '@atlaskit/editor-common/messages';
8
- import { BOLD_MENU_ITEM, CODE_MENU_ITEM, ITALIC_MENU_ITEM, STRIKE_MENU_ITEM, SUBSCRIPT_MENU_ITEM, SUPERSCRIPT_MENU_ITEM, TEXT_FORMATTING_MENU_SECTION_RANK, TOOLBARS, UNDERLINE_MENU_ITEM } from '@atlaskit/editor-common/toolbar';
8
+ import { BOLD_MENU_ITEM, CODE_MENU_ITEM, ITALIC_MENU_ITEM, STRIKE_MENU_ITEM, SUBSCRIPT_MENU_ITEM, SUPERSCRIPT_MENU_ITEM, TEXT_FORMATTING_MENU_SECTION_RANK, UNDERLINE_MENU_ITEM, getInputMethodFromParentKeys } from '@atlaskit/editor-common/toolbar';
9
9
  import { BoldIcon, ItalicIcon, UnderlineIcon, CodeIcon, StrikeThroughIcon, SubscriptIcon, SuperscriptIcon } from '@atlaskit/editor-toolbar';
10
10
  import { toggleStrongWithAnalytics, toggleEmWithAnalytics, toggleUnderlineWithAnalytics, toggleCodeWithAnalytics, toggleStrikeWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics } from '../../../editor-commands/toggle-mark';
11
- import { getInputMethod } from '../input-method-utils';
12
- import { ToolbarType } from '../types';
13
- export var getInputMethodFromParentKeys = function getInputMethodFromParentKeys(parentKeys) {
14
- var _parentKeys$at;
15
- return getInputMethod(((_parentKeys$at = parentKeys.at(-1)) === null || _parentKeys$at === void 0 ? void 0 : _parentKeys$at.key) === TOOLBARS.INLINE_TEXT_TOOLBAR ? ToolbarType.FLOATING : ToolbarType.PRIMARY);
16
- };
17
11
  var FormatMarkSchema = {
18
12
  strong: 'strong',
19
13
  em: 'em',
@@ -10,5 +10,5 @@ import type { TextFormattingPlugin } from '../../textFormattingPluginType';
10
10
  */
11
11
  export declare const nextToggleMark: (markType: MarkType, api: ExtractInjectionAPI<TextFormattingPlugin> | undefined, attrs?: {
12
12
  [key: string]: any;
13
- } | undefined) => EditorCommand;
13
+ }) => EditorCommand;
14
14
  export declare const nextApplyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction, api: ExtractInjectionAPI<TextFormattingPlugin> | undefined) => Transaction;
@@ -4,8 +4,8 @@ import { type ToolbarButtonGroupLocation } from '@atlaskit/editor-toolbar';
4
4
  import type { FormatComponentProps } from './utils';
5
5
  export declare const FormatMenuItem: ({ parents, api, optionType, toggleMarkWithAnalyticsCallback, icon, shortcut, title, }: FormatComponentProps) => React.JSX.Element | null;
6
6
  export declare const FormatButton: ({ parents, api, optionType, toggleMarkWithAnalyticsCallback, icon, shortcut, title, groupLocation, }: FormatComponentProps) => React.JSX.Element;
7
- export declare const ClearFormatMenuItem: ({ api, parents, }: Pick<FormatComponentProps, 'api' | 'parents'>) => React.JSX.Element | null;
7
+ export declare const ClearFormatMenuItem: ({ api, parents, }: Pick<FormatComponentProps, "api" | "parents">) => React.JSX.Element | null;
8
8
  export declare const MoreFormattingMenu: ({ children, groupLocation, }: {
9
9
  children?: ReactNode;
10
- groupLocation?: ToolbarButtonGroupLocation | undefined;
10
+ groupLocation?: ToolbarButtonGroupLocation;
11
11
  }) => React.JSX.Element;
@@ -2,13 +2,13 @@ import type { MessageDescriptor } from 'react-intl-next';
2
2
  import type { Keymap } from '@atlaskit/editor-common/keymaps';
3
3
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import { type IconComponent, type ToolbarButtonGroupLocation } from '@atlaskit/editor-toolbar';
5
- import type { ComponentTypes } from '@atlaskit/editor-toolbar-model';
5
+ import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
6
6
  import type { ToggleMarkWithAnalyticsEditorCommand, ClearFormattingWithAnalyticsEditorCommand } from '../../../editor-commands/types';
7
7
  import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
8
8
  import type { FormatOptions } from '../types';
9
9
  export type FormatComponentProps = {
10
10
  api?: ExtractInjectionAPI<TextFormattingPlugin>;
11
- parents: ComponentTypes;
11
+ parents: ToolbarComponentTypes;
12
12
  icon: IconComponent;
13
13
  shortcut: Keymap;
14
14
  title: MessageDescriptor;
@@ -17,8 +17,7 @@ export type FormatComponentProps = {
17
17
  ariaLabel?: string;
18
18
  groupLocation?: ToolbarButtonGroupLocation;
19
19
  };
20
- export declare const getInputMethodFromParentKeys: (parentKeys: ComponentTypes) => import("@atlaskit/editor-common/types").InputMethodToolbar;
21
- export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, 'icon' | 'ariaLabel' | 'groupLocation'>) => {
20
+ export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, "icon" | "ariaLabel" | "groupLocation">) => {
22
21
  formatTitle: string;
23
22
  shortcutContent: string | undefined;
24
23
  ariaLabel: string;
@@ -1,7 +1,7 @@
1
1
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  export declare const hasMultiplePartsWithFormattingInSelection: ({ selectedContent, }: {
3
- selectedContent?: PMNode[] | undefined;
3
+ selectedContent?: PMNode[];
4
4
  }) => boolean;
5
5
  export declare const getCommonActiveMarks: ({ selectedContent }: {
6
- selectedContent?: PMNode[] | undefined;
6
+ selectedContent?: PMNode[];
7
7
  }) => string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { WrappedComponentProps } from 'react-intl-next';
3
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
3
  import type { ExtractInjectionAPI, TextFormattingState, ToolbarSize } from '@atlaskit/editor-common/types';
@@ -10,5 +10,5 @@ export declare const SingleToolbarButtons: React.MemoExoticComponent<({ items, i
10
10
  items: MenuIconItem[];
11
11
  isReducedSpacing: boolean;
12
12
  editorView: EditorView;
13
- hasMultiplePartsWithFormattingSelected?: boolean | undefined;
13
+ hasMultiplePartsWithFormattingSelected?: boolean;
14
14
  }) => jsx.JSX.Element>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { WrappedComponentProps } from 'react-intl-next';
3
2
  import type { TOOLBAR_ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
4
3
  import type { Command } from '@atlaskit/editor-common/types';
@@ -10,5 +10,5 @@ import type { TextFormattingPlugin } from '../../textFormattingPluginType';
10
10
  */
11
11
  export declare const nextToggleMark: (markType: MarkType, api: ExtractInjectionAPI<TextFormattingPlugin> | undefined, attrs?: {
12
12
  [key: string]: any;
13
- } | undefined) => EditorCommand;
13
+ }) => EditorCommand;
14
14
  export declare const nextApplyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction, api: ExtractInjectionAPI<TextFormattingPlugin> | undefined) => Transaction;
@@ -4,8 +4,8 @@ import { type ToolbarButtonGroupLocation } from '@atlaskit/editor-toolbar';
4
4
  import type { FormatComponentProps } from './utils';
5
5
  export declare const FormatMenuItem: ({ parents, api, optionType, toggleMarkWithAnalyticsCallback, icon, shortcut, title, }: FormatComponentProps) => React.JSX.Element | null;
6
6
  export declare const FormatButton: ({ parents, api, optionType, toggleMarkWithAnalyticsCallback, icon, shortcut, title, groupLocation, }: FormatComponentProps) => React.JSX.Element;
7
- export declare const ClearFormatMenuItem: ({ api, parents, }: Pick<FormatComponentProps, 'api' | 'parents'>) => React.JSX.Element | null;
7
+ export declare const ClearFormatMenuItem: ({ api, parents, }: Pick<FormatComponentProps, "api" | "parents">) => React.JSX.Element | null;
8
8
  export declare const MoreFormattingMenu: ({ children, groupLocation, }: {
9
9
  children?: ReactNode;
10
- groupLocation?: ToolbarButtonGroupLocation | undefined;
10
+ groupLocation?: ToolbarButtonGroupLocation;
11
11
  }) => React.JSX.Element;
@@ -2,13 +2,13 @@ import type { MessageDescriptor } from 'react-intl-next';
2
2
  import type { Keymap } from '@atlaskit/editor-common/keymaps';
3
3
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import { type IconComponent, type ToolbarButtonGroupLocation } from '@atlaskit/editor-toolbar';
5
- import type { ComponentTypes } from '@atlaskit/editor-toolbar-model';
5
+ import type { ToolbarComponentTypes } from '@atlaskit/editor-toolbar-model';
6
6
  import type { ToggleMarkWithAnalyticsEditorCommand, ClearFormattingWithAnalyticsEditorCommand } from '../../../editor-commands/types';
7
7
  import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
8
8
  import type { FormatOptions } from '../types';
9
9
  export type FormatComponentProps = {
10
10
  api?: ExtractInjectionAPI<TextFormattingPlugin>;
11
- parents: ComponentTypes;
11
+ parents: ToolbarComponentTypes;
12
12
  icon: IconComponent;
13
13
  shortcut: Keymap;
14
14
  title: MessageDescriptor;
@@ -17,8 +17,7 @@ export type FormatComponentProps = {
17
17
  ariaLabel?: string;
18
18
  groupLocation?: ToolbarButtonGroupLocation;
19
19
  };
20
- export declare const getInputMethodFromParentKeys: (parentKeys: ComponentTypes) => import("@atlaskit/editor-common/types").InputMethodToolbar;
21
- export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, 'icon' | 'ariaLabel' | 'groupLocation'>) => {
20
+ export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, "icon" | "ariaLabel" | "groupLocation">) => {
22
21
  formatTitle: string;
23
22
  shortcutContent: string | undefined;
24
23
  ariaLabel: string;
@@ -1,7 +1,7 @@
1
1
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  export declare const hasMultiplePartsWithFormattingInSelection: ({ selectedContent, }: {
3
- selectedContent?: PMNode[] | undefined;
3
+ selectedContent?: PMNode[];
4
4
  }) => boolean;
5
5
  export declare const getCommonActiveMarks: ({ selectedContent }: {
6
- selectedContent?: PMNode[] | undefined;
6
+ selectedContent?: PMNode[];
7
7
  }) => string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { WrappedComponentProps } from 'react-intl-next';
3
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
3
  import type { ExtractInjectionAPI, TextFormattingState, ToolbarSize } from '@atlaskit/editor-common/types';
@@ -10,5 +10,5 @@ export declare const SingleToolbarButtons: React.MemoExoticComponent<({ items, i
10
10
  items: MenuIconItem[];
11
11
  isReducedSpacing: boolean;
12
12
  editorView: EditorView;
13
- hasMultiplePartsWithFormattingSelected?: boolean | undefined;
13
+ hasMultiplePartsWithFormattingSelected?: boolean;
14
14
  }) => jsx.JSX.Element>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { WrappedComponentProps } from 'react-intl-next';
3
2
  import type { TOOLBAR_ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
4
3
  import type { Command } from '@atlaskit/editor-common/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "3.0.10",
3
+ "version": "3.0.12",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,23 +37,23 @@
37
37
  "@atlaskit/editor-plugin-base": "^4.1.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
39
39
  "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
40
- "@atlaskit/editor-plugin-toolbar": "^0.1.0",
40
+ "@atlaskit/editor-plugin-toolbar": "^0.2.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-shared-styles": "^3.5.0",
42
+ "@atlaskit/editor-shared-styles": "^3.6.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
- "@atlaskit/editor-toolbar": "^0.1.0",
45
- "@atlaskit/editor-toolbar-model": "^0.0.4",
46
- "@atlaskit/icon": "^27.10.0",
44
+ "@atlaskit/editor-toolbar": "^0.2.0",
45
+ "@atlaskit/editor-toolbar-model": "^0.1.0",
46
+ "@atlaskit/icon": "^27.11.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
49
- "@atlaskit/tmp-editor-statsig": "^9.25.0",
49
+ "@atlaskit/tmp-editor-statsig": "^9.27.0",
50
50
  "@atlaskit/tokens": "^6.0.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "@emotion/react": "^11.7.1",
53
53
  "react-intl-next": "npm:react-intl@^5.18.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^107.19.0",
56
+ "@atlaskit/editor-common": "^107.21.0",
57
57
  "react": "^18.2.0"
58
58
  },
59
59
  "devDependencies": {