@atlaskit/editor-plugin-text-formatting 3.0.22 → 3.0.23

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/types/textFormattingPluginType.d.ts +10 -10
  3. package/dist/types/ui/FloatingToolbarComponent.d.ts +1 -1
  4. package/dist/types/ui/PrimaryToolbarComponent.d.ts +3 -3
  5. package/dist/types/ui/Toolbar/components/utils.d.ts +7 -7
  6. package/dist/types/ui/Toolbar/dropdown-menu.d.ts +3 -3
  7. package/dist/types/ui/Toolbar/dropdown-toolbar-button.d.ts +5 -5
  8. package/dist/types/ui/Toolbar/hooks/clear-formatting-icon.d.ts +1 -1
  9. package/dist/types/ui/Toolbar/hooks/formatting-icons.d.ts +2 -2
  10. package/dist/types/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +3 -3
  11. package/dist/types/ui/Toolbar/index.d.ts +6 -6
  12. package/dist/types/ui/Toolbar/more-button.d.ts +3 -3
  13. package/dist/types/ui/Toolbar/single-toolbar-buttons.d.ts +2 -2
  14. package/dist/types/ui/Toolbar/types.d.ts +3 -3
  15. package/dist/types-ts4.5/textFormattingPluginType.d.ts +10 -10
  16. package/dist/types-ts4.5/ui/FloatingToolbarComponent.d.ts +1 -1
  17. package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +3 -3
  18. package/dist/types-ts4.5/ui/Toolbar/components/utils.d.ts +7 -7
  19. package/dist/types-ts4.5/ui/Toolbar/dropdown-menu.d.ts +3 -3
  20. package/dist/types-ts4.5/ui/Toolbar/dropdown-toolbar-button.d.ts +5 -5
  21. package/dist/types-ts4.5/ui/Toolbar/hooks/clear-formatting-icon.d.ts +1 -1
  22. package/dist/types-ts4.5/ui/Toolbar/hooks/formatting-icons.d.ts +2 -2
  23. package/dist/types-ts4.5/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +3 -3
  24. package/dist/types-ts4.5/ui/Toolbar/index.d.ts +6 -6
  25. package/dist/types-ts4.5/ui/Toolbar/more-button.d.ts +3 -3
  26. package/dist/types-ts4.5/ui/Toolbar/single-toolbar-buttons.d.ts +2 -2
  27. package/dist/types-ts4.5/ui/Toolbar/types.d.ts +3 -3
  28. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-text-formatting
2
2
 
3
+ ## 3.0.23
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
3
11
  ## 3.0.22
4
12
 
5
13
  ### Patch Changes
@@ -8,7 +8,15 @@ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-prefere
8
8
  import type { ToggleMarkEditorCommand } from './editor-commands/types';
9
9
  export type TextFormattingPluginOptions = CommonTextFormattingOptions;
10
10
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
11
- pluginConfiguration: TextFormattingPluginOptions | undefined;
11
+ commands: {
12
+ toggleCode: ToggleMarkEditorCommand;
13
+ toggleEm: ToggleMarkEditorCommand;
14
+ toggleStrike: ToggleMarkEditorCommand;
15
+ toggleStrong: ToggleMarkEditorCommand;
16
+ toggleSubscript: ToggleMarkEditorCommand;
17
+ toggleSuperscript: ToggleMarkEditorCommand;
18
+ toggleUnderline: ToggleMarkEditorCommand;
19
+ };
12
20
  dependencies: [
13
21
  OptionalPlugin<AnalyticsPlugin>,
14
22
  OptionalPlugin<PrimaryToolbarPlugin>,
@@ -17,14 +25,6 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
17
25
  OptionalPlugin<UserPreferencesPlugin>,
18
26
  OptionalPlugin<ToolbarPlugin>
19
27
  ];
20
- commands: {
21
- toggleSuperscript: ToggleMarkEditorCommand;
22
- toggleSubscript: ToggleMarkEditorCommand;
23
- toggleStrike: ToggleMarkEditorCommand;
24
- toggleCode: ToggleMarkEditorCommand;
25
- toggleUnderline: ToggleMarkEditorCommand;
26
- toggleEm: ToggleMarkEditorCommand;
27
- toggleStrong: ToggleMarkEditorCommand;
28
- };
28
+ pluginConfiguration: TextFormattingPluginOptions | undefined;
29
29
  sharedState: TextFormattingState | undefined;
30
30
  }>;
@@ -9,9 +9,9 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
11
11
  type FloatingToolbarComponentProps = {
12
- editorView: EditorView;
13
12
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
14
13
  editorAnalyticsAPI?: EditorAnalyticsAPI;
14
+ editorView: EditorView;
15
15
  } & WrappedComponentProps;
16
16
  export declare const FloatingToolbarTextFormalWithIntl: React.FC<import("react-intl-next").WithIntlProps<FloatingToolbarComponentProps>> & {
17
17
  WrappedComponent: React.ComponentType<FloatingToolbarComponentProps>;
@@ -4,13 +4,13 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
5
5
  interface PrimaryToolbarComponentProps {
6
6
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
7
+ disabled: boolean;
7
8
  editorView: EditorView;
9
+ isReducedSpacing: boolean;
8
10
  popupsMountPoint?: HTMLElement;
9
11
  popupsScrollableElement?: HTMLElement;
10
- toolbarSize: ToolbarSize;
11
- disabled: boolean;
12
- isReducedSpacing: boolean;
13
12
  shouldUseResponsiveToolbar: boolean;
13
+ toolbarSize: ToolbarSize;
14
14
  }
15
15
  export declare function PrimaryToolbarComponent({ api, popupsMountPoint, popupsScrollableElement, toolbarSize, editorView, disabled, isReducedSpacing, shouldUseResponsiveToolbar, }: PrimaryToolbarComponentProps): React.JSX.Element;
16
16
  export declare const PrimaryToolbarComponentMemoized: React.MemoExoticComponent<typeof PrimaryToolbarComponent>;
@@ -8,13 +8,13 @@ import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
8
8
  import type { FormatOptions } from '../types';
9
9
  export type FormatComponentProps = {
10
10
  api?: ExtractInjectionAPI<TextFormattingPlugin>;
11
- parents: ToolbarComponentTypes;
11
+ ariaLabel?: string;
12
12
  icon: IconComponent;
13
+ optionType: FormatOptions;
14
+ parents: ToolbarComponentTypes;
13
15
  shortcut: Keymap;
14
16
  title: MessageDescriptor;
15
- optionType: FormatOptions;
16
17
  toggleMarkWithAnalyticsCallback: ToggleMarkWithAnalyticsEditorCommand | ClearFormattingWithAnalyticsEditorCommand;
17
- ariaLabel?: string;
18
18
  };
19
19
  export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, "icon" | "ariaLabel" | "groupLocation">) => {
20
20
  formatTitle: string;
@@ -26,12 +26,12 @@ export declare const useComponentInfo: ({ api, optionType, title, shortcut, togg
26
26
  isHidden: boolean;
27
27
  };
28
28
  type FormatOptionInfo = {
29
- rank: number;
30
- key: string;
31
- icon: IconComponent;
32
- title: MessageDescriptor;
33
29
  command: ToggleMarkWithAnalyticsEditorCommand;
30
+ icon: IconComponent;
31
+ key: string;
32
+ rank: number;
34
33
  shortcut: Keymap;
34
+ title: MessageDescriptor;
35
35
  };
36
36
  export declare const formatOptions: () => Record<FormatOptions, FormatOptionInfo>;
37
37
  export {};
@@ -4,18 +4,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import { type MenuIconItem, type ToolbarType } from './types';
5
5
  type DropdownMenuProps = {
6
6
  editorView: EditorView;
7
+ hasFormattingActive: boolean;
8
+ hasMoreButton: boolean;
9
+ isDisabled?: boolean;
7
10
  isReducedSpacing: boolean;
8
11
  items: {
9
12
  items: MenuIconItem[];
10
13
  }[];
11
14
  moreButtonLabel: string;
12
- hasFormattingActive: boolean;
13
15
  popupsBoundariesElement?: HTMLElement;
14
16
  popupsMountPoint?: HTMLElement;
15
17
  popupsScrollableElement?: HTMLElement;
16
- hasMoreButton: boolean;
17
18
  toolbarType: ToolbarType;
18
- isDisabled?: boolean;
19
19
  } & WrappedComponentProps;
20
20
  export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, isDisabled, }: DropdownMenuProps) => React.JSX.Element>;
21
21
  export {};
@@ -6,16 +6,16 @@ import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ToolbarType } from './types';
8
8
  type DropdownButtonProps = {
9
- label: string;
9
+ activeIconName?: string;
10
+ 'aria-expanded': React.AriaAttributes['aria-expanded'];
11
+ iconBefore?: React.ReactElement;
12
+ isDisabled: boolean;
10
13
  isReducedSpacing: boolean;
11
14
  isSelected: boolean;
12
- isDisabled: boolean;
13
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
15
+ label: string;
14
16
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
15
17
  onKeyDown?: (event: React.KeyboardEvent) => void;
16
18
  toolbarType: ToolbarType;
17
- iconBefore?: React.ReactElement;
18
- activeIconName?: string;
19
19
  };
20
20
  export declare const DropdownToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, toolbarType, iconBefore, activeIconName, }: DropdownButtonProps) => jsx.JSX.Element;
21
21
  export {};
@@ -2,8 +2,8 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { IconHookProps, MenuIconItem, ToolbarType } from '../types';
3
3
  interface ClearIconHookProps extends IconHookProps {
4
4
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
5
- formattingPluginInitialised: boolean | undefined;
6
5
  formattingIsPresent: boolean | undefined;
6
+ formattingPluginInitialised: boolean | undefined;
7
7
  toolbarType: ToolbarType;
8
8
  }
9
9
  export declare const useClearIcon: ({ intl, formattingPluginInitialised, formattingIsPresent: formattingPresent, editorAnalyticsAPI, toolbarType, }: ClearIconHookProps) => MenuIconItem | null;
@@ -5,14 +5,14 @@ import type { IconHookProps, MenuIconItem } from '../types';
5
5
  import { IconTypes, type ToolbarType } from '../types';
6
6
  interface FormattingIconHookProps extends IconHookProps {
7
7
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
8
- textFormattingState: TextFormattingState | undefined;
9
8
  schema: Schema;
9
+ textFormattingState: TextFormattingState | undefined;
10
10
  toolbarType: ToolbarType;
11
11
  }
12
12
  export declare const useFormattingIcons: ({ isToolbarDisabled, textFormattingState, schema, intl, editorAnalyticsAPI, toolbarType, }: FormattingIconHookProps) => Array<MenuIconItem | null>;
13
13
  type Props = {
14
- textFormattingState: TextFormattingState | undefined;
15
14
  iconTypeList: IconTypes[];
15
+ textFormattingState: TextFormattingState | undefined;
16
16
  };
17
17
  export declare const useHasFormattingActived: ({ iconTypeList, textFormattingState }: Props) => boolean;
18
18
  export {};
@@ -2,15 +2,15 @@ import type { ToolbarSize } from '@atlaskit/editor-common/types';
2
2
  import type { IconTypes, MenuIconItem } from '../types';
3
3
  import { type IconsPositions } from './use-icon-list';
4
4
  export declare const useResponsiveIconTypeButtons: ({ toolbarSize, responsivenessEnabled, }: {
5
- toolbarSize: ToolbarSize;
6
5
  responsivenessEnabled: boolean;
6
+ toolbarSize: ToolbarSize;
7
7
  }) => IconTypes[];
8
8
  export declare const useResponsiveIconTypeMenu: ({ toolbarSize, responsivenessEnabled, }: {
9
- toolbarSize: ToolbarSize;
10
9
  responsivenessEnabled: boolean;
10
+ toolbarSize: ToolbarSize;
11
11
  }) => IconTypes[];
12
12
  export declare const useResponsiveToolbarButtons: ({ icons, toolbarSize, responsivenessEnabled, }: {
13
+ icons: Array<MenuIconItem | null>;
13
14
  responsivenessEnabled: boolean;
14
15
  toolbarSize: ToolbarSize;
15
- icons: Array<MenuIconItem | null>;
16
16
  }) => IconsPositions;
@@ -5,17 +5,17 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { TextFormattingPlugin } from '../../textFormattingPluginType';
6
6
  import type { ToolbarType } from './types';
7
7
  export type ToolbarFormattingProps = {
8
+ api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
9
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
8
10
  editorView: EditorView;
9
- isToolbarDisabled: boolean;
10
- toolbarSize: ToolbarSize;
11
11
  isReducedSpacing: boolean;
12
- shouldUseResponsiveToolbar: boolean;
13
- popupsMountPoint?: HTMLElement;
12
+ isToolbarDisabled: boolean;
14
13
  popupsBoundariesElement?: HTMLElement;
14
+ popupsMountPoint?: HTMLElement;
15
15
  popupsScrollableElement?: HTMLElement;
16
- editorAnalyticsAPI?: EditorAnalyticsAPI;
16
+ shouldUseResponsiveToolbar: boolean;
17
17
  textFormattingState: TextFormattingState;
18
- api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
18
+ toolbarSize: ToolbarSize;
19
19
  toolbarType: ToolbarType;
20
20
  };
21
21
  declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<ToolbarFormattingProps & WrappedComponentProps>> & {
@@ -5,11 +5,11 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  type MoreButtonProps = {
8
- label: string;
8
+ 'aria-expanded': React.AriaAttributes['aria-expanded'];
9
+ isDisabled: boolean;
9
10
  isReducedSpacing: boolean;
10
11
  isSelected: boolean;
11
- isDisabled: boolean;
12
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
12
+ label: string;
13
13
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
14
14
  onKeyDown?: (event: React.KeyboardEvent) => void;
15
15
  };
@@ -7,7 +7,7 @@ import { jsx } from '@emotion/react';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { MenuIconItem } from './types';
9
9
  export declare const SingleToolbarButtons: React.MemoExoticComponent<({ items, isReducedSpacing, editorView, }: {
10
- items: MenuIconItem[];
11
- isReducedSpacing: boolean;
12
10
  editorView: EditorView;
11
+ isReducedSpacing: boolean;
12
+ items: MenuIconItem[];
13
13
  }) => jsx.JSX.Element>;
@@ -26,17 +26,17 @@ export type FormatOptionState = {
26
26
  isHidden: boolean;
27
27
  };
28
28
  export interface MenuIconItem extends MenuItem {
29
+ buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
29
30
  command: Command;
31
+ iconElement?: React.ReactElement;
30
32
  iconMark?: IconTypes;
31
33
  tooltipElement?: React.ReactElement;
32
- iconElement?: React.ReactElement;
33
- buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
34
34
  }
35
35
  export type MenuIconState = {
36
+ hasSchemaMark: boolean;
36
37
  isActive: boolean;
37
38
  isDisabled: boolean;
38
39
  isHidden: boolean;
39
- hasSchemaMark: boolean;
40
40
  };
41
41
  export type IconHookProps = {
42
42
  isToolbarDisabled?: boolean;
@@ -8,7 +8,15 @@ import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-prefere
8
8
  import type { ToggleMarkEditorCommand } from './editor-commands/types';
9
9
  export type TextFormattingPluginOptions = CommonTextFormattingOptions;
10
10
  export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
11
- pluginConfiguration: TextFormattingPluginOptions | undefined;
11
+ commands: {
12
+ toggleCode: ToggleMarkEditorCommand;
13
+ toggleEm: ToggleMarkEditorCommand;
14
+ toggleStrike: ToggleMarkEditorCommand;
15
+ toggleStrong: ToggleMarkEditorCommand;
16
+ toggleSubscript: ToggleMarkEditorCommand;
17
+ toggleSuperscript: ToggleMarkEditorCommand;
18
+ toggleUnderline: ToggleMarkEditorCommand;
19
+ };
12
20
  dependencies: [
13
21
  OptionalPlugin<AnalyticsPlugin>,
14
22
  OptionalPlugin<PrimaryToolbarPlugin>,
@@ -17,14 +25,6 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
17
25
  OptionalPlugin<UserPreferencesPlugin>,
18
26
  OptionalPlugin<ToolbarPlugin>
19
27
  ];
20
- commands: {
21
- toggleSuperscript: ToggleMarkEditorCommand;
22
- toggleSubscript: ToggleMarkEditorCommand;
23
- toggleStrike: ToggleMarkEditorCommand;
24
- toggleCode: ToggleMarkEditorCommand;
25
- toggleUnderline: ToggleMarkEditorCommand;
26
- toggleEm: ToggleMarkEditorCommand;
27
- toggleStrong: ToggleMarkEditorCommand;
28
- };
28
+ pluginConfiguration: TextFormattingPluginOptions | undefined;
29
29
  sharedState: TextFormattingState | undefined;
30
30
  }>;
@@ -9,9 +9,9 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
11
11
  type FloatingToolbarComponentProps = {
12
- editorView: EditorView;
13
12
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
14
13
  editorAnalyticsAPI?: EditorAnalyticsAPI;
14
+ editorView: EditorView;
15
15
  } & WrappedComponentProps;
16
16
  export declare const FloatingToolbarTextFormalWithIntl: React.FC<import("react-intl-next").WithIntlProps<FloatingToolbarComponentProps>> & {
17
17
  WrappedComponent: React.ComponentType<FloatingToolbarComponentProps>;
@@ -4,13 +4,13 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TextFormattingPlugin } from '../textFormattingPluginType';
5
5
  interface PrimaryToolbarComponentProps {
6
6
  api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
7
+ disabled: boolean;
7
8
  editorView: EditorView;
9
+ isReducedSpacing: boolean;
8
10
  popupsMountPoint?: HTMLElement;
9
11
  popupsScrollableElement?: HTMLElement;
10
- toolbarSize: ToolbarSize;
11
- disabled: boolean;
12
- isReducedSpacing: boolean;
13
12
  shouldUseResponsiveToolbar: boolean;
13
+ toolbarSize: ToolbarSize;
14
14
  }
15
15
  export declare function PrimaryToolbarComponent({ api, popupsMountPoint, popupsScrollableElement, toolbarSize, editorView, disabled, isReducedSpacing, shouldUseResponsiveToolbar, }: PrimaryToolbarComponentProps): React.JSX.Element;
16
16
  export declare const PrimaryToolbarComponentMemoized: React.MemoExoticComponent<typeof PrimaryToolbarComponent>;
@@ -8,13 +8,13 @@ import { type TextFormattingPlugin } from '../../../textFormattingPluginType';
8
8
  import type { FormatOptions } from '../types';
9
9
  export type FormatComponentProps = {
10
10
  api?: ExtractInjectionAPI<TextFormattingPlugin>;
11
- parents: ToolbarComponentTypes;
11
+ ariaLabel?: string;
12
12
  icon: IconComponent;
13
+ optionType: FormatOptions;
14
+ parents: ToolbarComponentTypes;
13
15
  shortcut: Keymap;
14
16
  title: MessageDescriptor;
15
- optionType: FormatOptions;
16
17
  toggleMarkWithAnalyticsCallback: ToggleMarkWithAnalyticsEditorCommand | ClearFormattingWithAnalyticsEditorCommand;
17
- ariaLabel?: string;
18
18
  };
19
19
  export declare const useComponentInfo: ({ api, optionType, title, shortcut, toggleMarkWithAnalyticsCallback, parents, }: Omit<FormatComponentProps, "icon" | "ariaLabel" | "groupLocation">) => {
20
20
  formatTitle: string;
@@ -26,12 +26,12 @@ export declare const useComponentInfo: ({ api, optionType, title, shortcut, togg
26
26
  isHidden: boolean;
27
27
  };
28
28
  type FormatOptionInfo = {
29
- rank: number;
30
- key: string;
31
- icon: IconComponent;
32
- title: MessageDescriptor;
33
29
  command: ToggleMarkWithAnalyticsEditorCommand;
30
+ icon: IconComponent;
31
+ key: string;
32
+ rank: number;
34
33
  shortcut: Keymap;
34
+ title: MessageDescriptor;
35
35
  };
36
36
  export declare const formatOptions: () => Record<FormatOptions, FormatOptionInfo>;
37
37
  export {};
@@ -4,18 +4,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import { type MenuIconItem, type ToolbarType } from './types';
5
5
  type DropdownMenuProps = {
6
6
  editorView: EditorView;
7
+ hasFormattingActive: boolean;
8
+ hasMoreButton: boolean;
9
+ isDisabled?: boolean;
7
10
  isReducedSpacing: boolean;
8
11
  items: {
9
12
  items: MenuIconItem[];
10
13
  }[];
11
14
  moreButtonLabel: string;
12
- hasFormattingActive: boolean;
13
15
  popupsBoundariesElement?: HTMLElement;
14
16
  popupsMountPoint?: HTMLElement;
15
17
  popupsScrollableElement?: HTMLElement;
16
- hasMoreButton: boolean;
17
18
  toolbarType: ToolbarType;
18
- isDisabled?: boolean;
19
19
  } & WrappedComponentProps;
20
20
  export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, isDisabled, }: DropdownMenuProps) => React.JSX.Element>;
21
21
  export {};
@@ -6,16 +6,16 @@ import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ToolbarType } from './types';
8
8
  type DropdownButtonProps = {
9
- label: string;
9
+ activeIconName?: string;
10
+ 'aria-expanded': React.AriaAttributes['aria-expanded'];
11
+ iconBefore?: React.ReactElement;
12
+ isDisabled: boolean;
10
13
  isReducedSpacing: boolean;
11
14
  isSelected: boolean;
12
- isDisabled: boolean;
13
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
15
+ label: string;
14
16
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
15
17
  onKeyDown?: (event: React.KeyboardEvent) => void;
16
18
  toolbarType: ToolbarType;
17
- iconBefore?: React.ReactElement;
18
- activeIconName?: string;
19
19
  };
20
20
  export declare const DropdownToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, toolbarType, iconBefore, activeIconName, }: DropdownButtonProps) => jsx.JSX.Element;
21
21
  export {};
@@ -2,8 +2,8 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { IconHookProps, MenuIconItem, ToolbarType } from '../types';
3
3
  interface ClearIconHookProps extends IconHookProps {
4
4
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
5
- formattingPluginInitialised: boolean | undefined;
6
5
  formattingIsPresent: boolean | undefined;
6
+ formattingPluginInitialised: boolean | undefined;
7
7
  toolbarType: ToolbarType;
8
8
  }
9
9
  export declare const useClearIcon: ({ intl, formattingPluginInitialised, formattingIsPresent: formattingPresent, editorAnalyticsAPI, toolbarType, }: ClearIconHookProps) => MenuIconItem | null;
@@ -5,14 +5,14 @@ import type { IconHookProps, MenuIconItem } from '../types';
5
5
  import { IconTypes, type ToolbarType } from '../types';
6
6
  interface FormattingIconHookProps extends IconHookProps {
7
7
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
8
- textFormattingState: TextFormattingState | undefined;
9
8
  schema: Schema;
9
+ textFormattingState: TextFormattingState | undefined;
10
10
  toolbarType: ToolbarType;
11
11
  }
12
12
  export declare const useFormattingIcons: ({ isToolbarDisabled, textFormattingState, schema, intl, editorAnalyticsAPI, toolbarType, }: FormattingIconHookProps) => Array<MenuIconItem | null>;
13
13
  type Props = {
14
- textFormattingState: TextFormattingState | undefined;
15
14
  iconTypeList: IconTypes[];
15
+ textFormattingState: TextFormattingState | undefined;
16
16
  };
17
17
  export declare const useHasFormattingActived: ({ iconTypeList, textFormattingState }: Props) => boolean;
18
18
  export {};
@@ -2,15 +2,15 @@ import type { ToolbarSize } from '@atlaskit/editor-common/types';
2
2
  import type { IconTypes, MenuIconItem } from '../types';
3
3
  import { type IconsPositions } from './use-icon-list';
4
4
  export declare const useResponsiveIconTypeButtons: ({ toolbarSize, responsivenessEnabled, }: {
5
- toolbarSize: ToolbarSize;
6
5
  responsivenessEnabled: boolean;
6
+ toolbarSize: ToolbarSize;
7
7
  }) => IconTypes[];
8
8
  export declare const useResponsiveIconTypeMenu: ({ toolbarSize, responsivenessEnabled, }: {
9
- toolbarSize: ToolbarSize;
10
9
  responsivenessEnabled: boolean;
10
+ toolbarSize: ToolbarSize;
11
11
  }) => IconTypes[];
12
12
  export declare const useResponsiveToolbarButtons: ({ icons, toolbarSize, responsivenessEnabled, }: {
13
+ icons: Array<MenuIconItem | null>;
13
14
  responsivenessEnabled: boolean;
14
15
  toolbarSize: ToolbarSize;
15
- icons: Array<MenuIconItem | null>;
16
16
  }) => IconsPositions;
@@ -5,17 +5,17 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { TextFormattingPlugin } from '../../textFormattingPluginType';
6
6
  import type { ToolbarType } from './types';
7
7
  export type ToolbarFormattingProps = {
8
+ api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
9
+ editorAnalyticsAPI?: EditorAnalyticsAPI;
8
10
  editorView: EditorView;
9
- isToolbarDisabled: boolean;
10
- toolbarSize: ToolbarSize;
11
11
  isReducedSpacing: boolean;
12
- shouldUseResponsiveToolbar: boolean;
13
- popupsMountPoint?: HTMLElement;
12
+ isToolbarDisabled: boolean;
14
13
  popupsBoundariesElement?: HTMLElement;
14
+ popupsMountPoint?: HTMLElement;
15
15
  popupsScrollableElement?: HTMLElement;
16
- editorAnalyticsAPI?: EditorAnalyticsAPI;
16
+ shouldUseResponsiveToolbar: boolean;
17
17
  textFormattingState: TextFormattingState;
18
- api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
18
+ toolbarSize: ToolbarSize;
19
19
  toolbarType: ToolbarType;
20
20
  };
21
21
  declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<ToolbarFormattingProps & WrappedComponentProps>> & {
@@ -5,11 +5,11 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  type MoreButtonProps = {
8
- label: string;
8
+ 'aria-expanded': React.AriaAttributes['aria-expanded'];
9
+ isDisabled: boolean;
9
10
  isReducedSpacing: boolean;
10
11
  isSelected: boolean;
11
- isDisabled: boolean;
12
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
12
+ label: string;
13
13
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
14
14
  onKeyDown?: (event: React.KeyboardEvent) => void;
15
15
  };
@@ -7,7 +7,7 @@ import { jsx } from '@emotion/react';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { MenuIconItem } from './types';
9
9
  export declare const SingleToolbarButtons: React.MemoExoticComponent<({ items, isReducedSpacing, editorView, }: {
10
- items: MenuIconItem[];
11
- isReducedSpacing: boolean;
12
10
  editorView: EditorView;
11
+ isReducedSpacing: boolean;
12
+ items: MenuIconItem[];
13
13
  }) => jsx.JSX.Element>;
@@ -26,17 +26,17 @@ export type FormatOptionState = {
26
26
  isHidden: boolean;
27
27
  };
28
28
  export interface MenuIconItem extends MenuItem {
29
+ buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
29
30
  command: Command;
31
+ iconElement?: React.ReactElement;
30
32
  iconMark?: IconTypes;
31
33
  tooltipElement?: React.ReactElement;
32
- iconElement?: React.ReactElement;
33
- buttonId?: TOOLBAR_ACTION_SUBJECT_ID;
34
34
  }
35
35
  export type MenuIconState = {
36
+ hasSchemaMark: boolean;
36
37
  isActive: boolean;
37
38
  isDisabled: boolean;
38
39
  isHidden: boolean;
39
- hasSchemaMark: boolean;
40
40
  };
41
41
  export type IconHookProps = {
42
42
  isToolbarDisabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-formatting",
3
- "version": "3.0.22",
3
+ "version": "3.0.23",
4
4
  "description": "Text-formatting plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",