@atlaskit/editor-plugin-floating-toolbar 5.1.12 → 5.2.1
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 +19 -0
- package/dist/cjs/floatingToolbarPlugin.js +11 -0
- package/dist/es2019/floatingToolbarPlugin.js +12 -1
- package/dist/esm/floatingToolbarPlugin.js +12 -1
- package/dist/types/floatingToolbarPluginType.d.ts +2 -2
- package/dist/types/pm-plugins/toolbar-data/types.d.ts +1 -1
- package/dist/types/ui/Dropdown.d.ts +19 -19
- package/dist/types/ui/DropdownMenu.d.ts +5 -5
- package/dist/types/ui/EmojiPickerButton.d.ts +4 -4
- package/dist/types/ui/ExtensionsPlaceholder.d.ts +9 -9
- package/dist/types/ui/Input.d.ts +2 -2
- package/dist/types/ui/ScrollButton.d.ts +2 -2
- package/dist/types/ui/ScrollButtons.d.ts +2 -2
- package/dist/types/ui/Select.d.ts +10 -10
- package/dist/types/ui/Toolbar.d.ts +13 -13
- package/dist/types-ts4.5/floatingToolbarPluginType.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/toolbar-data/types.d.ts +1 -1
- package/dist/types-ts4.5/ui/Dropdown.d.ts +19 -19
- package/dist/types-ts4.5/ui/DropdownMenu.d.ts +5 -5
- package/dist/types-ts4.5/ui/EmojiPickerButton.d.ts +4 -4
- package/dist/types-ts4.5/ui/ExtensionsPlaceholder.d.ts +9 -9
- package/dist/types-ts4.5/ui/Input.d.ts +2 -2
- package/dist/types-ts4.5/ui/ScrollButton.d.ts +2 -2
- package/dist/types-ts4.5/ui/ScrollButtons.d.ts +2 -2
- package/dist/types-ts4.5/ui/Select.d.ts +10 -10
- package/dist/types-ts4.5/ui/Toolbar.d.ts +13 -13
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 5.2.1
|
|
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
|
+
|
|
11
|
+
## 5.2.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`e73faa5a52300`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e73faa5a52300) -
|
|
16
|
+
[ux] ED-28735 Fix selection toolbar opening and closing state
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 5.1.12
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -23,6 +23,7 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
23
23
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
24
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
25
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
26
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
26
27
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
27
28
|
var _commands = require("./pm-plugins/commands");
|
|
28
29
|
var _forceFocus = _interopRequireWildcard(require("./pm-plugins/force-focus"));
|
|
@@ -241,6 +242,16 @@ function ContentComponent(_ref5) {
|
|
|
241
242
|
|
|
242
243
|
var config = configWithNodeInfo.config,
|
|
243
244
|
node = configWithNodeInfo.node;
|
|
245
|
+
|
|
246
|
+
// When the new inline editor-toolbar is enabled, suppress floating toolbar for text selections.
|
|
247
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true)) {
|
|
248
|
+
var selection = editorView.state.selection;
|
|
249
|
+
var isCellSelection = '$anchorCell' in selection && !selection.empty;
|
|
250
|
+
var isTextSelected = selection instanceof _state.TextSelection && !selection.empty;
|
|
251
|
+
if (isTextSelected || isCellSelection) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
244
255
|
var items = config.items;
|
|
245
256
|
var groupLabel = config.groupLabel;
|
|
246
257
|
var title = config.title,
|
|
@@ -10,8 +10,9 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
11
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
12
12
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
13
|
-
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
|
+
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
14
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
17
|
import { copyNode } from './pm-plugins/commands';
|
|
17
18
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
@@ -233,6 +234,16 @@ export function ContentComponent({
|
|
|
233
234
|
config,
|
|
234
235
|
node
|
|
235
236
|
} = configWithNodeInfo;
|
|
237
|
+
|
|
238
|
+
// When the new inline editor-toolbar is enabled, suppress floating toolbar for text selections.
|
|
239
|
+
if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
|
|
240
|
+
const selection = editorView.state.selection;
|
|
241
|
+
const isCellSelection = '$anchorCell' in selection && !selection.empty;
|
|
242
|
+
const isTextSelected = selection instanceof TextSelection && !selection.empty;
|
|
243
|
+
if (isTextSelected || isCellSelection) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
236
247
|
let {
|
|
237
248
|
items
|
|
238
249
|
} = config;
|
|
@@ -14,8 +14,9 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
14
14
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
15
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
16
16
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
17
|
-
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
17
|
+
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
18
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
19
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
21
|
import { copyNode as _copyNode } from './pm-plugins/commands';
|
|
21
22
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
@@ -232,6 +233,16 @@ export function ContentComponent(_ref5) {
|
|
|
232
233
|
|
|
233
234
|
var config = configWithNodeInfo.config,
|
|
234
235
|
node = configWithNodeInfo.node;
|
|
236
|
+
|
|
237
|
+
// When the new inline editor-toolbar is enabled, suppress floating toolbar for text selections.
|
|
238
|
+
if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
|
|
239
|
+
var selection = editorView.state.selection;
|
|
240
|
+
var isCellSelection = '$anchorCell' in selection && !selection.empty;
|
|
241
|
+
var isTextSelected = selection instanceof TextSelection && !selection.empty;
|
|
242
|
+
if (isTextSelected || isCellSelection) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
235
246
|
var items = config.items;
|
|
236
247
|
var groupLabel = config.groupLabel;
|
|
237
248
|
var title = config.title,
|
|
@@ -14,8 +14,8 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
14
14
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
15
15
|
export type ConfigWithNodeInfo = {
|
|
16
16
|
config: FloatingToolbarConfig | undefined;
|
|
17
|
-
pos: number;
|
|
18
17
|
node: Node;
|
|
18
|
+
pos: number;
|
|
19
19
|
};
|
|
20
20
|
export type FloatingToolbarPluginState = {
|
|
21
21
|
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
@@ -42,10 +42,10 @@ export type FloatingToolbarPluginDependencies = [
|
|
|
42
42
|
OptionalPlugin<AnalyticsPlugin>
|
|
43
43
|
];
|
|
44
44
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
45
|
-
dependencies: FloatingToolbarPluginDependencies;
|
|
46
45
|
actions: {
|
|
47
46
|
forceFocusSelector: ForceFocusSelector;
|
|
48
47
|
};
|
|
48
|
+
dependencies: FloatingToolbarPluginDependencies;
|
|
49
49
|
sharedState: {
|
|
50
50
|
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
51
51
|
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
@@ -10,33 +10,33 @@ import type { CommandDispatch, DropdownOptions, ExtensionDropdownOptions, Floati
|
|
|
10
10
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
export interface Props {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
iconBefore?: ReactElement<any>;
|
|
16
|
-
hideExpandIcon?: boolean;
|
|
17
|
-
options: DropdownOptions<Function> | FloatingToolbarOverflowDropdownOptions<Function> | ExtensionDropdownOptions;
|
|
18
|
-
dispatchCommand: (command: Function) => void;
|
|
19
|
-
mountPoint?: HTMLElement;
|
|
13
|
+
alignDropdownWithToolbar?: boolean;
|
|
14
|
+
alignX?: 'left' | 'right' | 'center';
|
|
20
15
|
boundariesElement?: HTMLElement;
|
|
21
|
-
scrollableElement?: HTMLElement;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
tooltip?: string;
|
|
24
16
|
buttonTestId?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
dispatchCommand: (command: Function) => void;
|
|
19
|
+
dropdownListId?: string;
|
|
25
20
|
dropdownWidth?: number;
|
|
26
|
-
showSelected?: boolean;
|
|
27
|
-
setDisableParentScroll?: (disable: boolean) => void;
|
|
28
21
|
editorView?: EditorView;
|
|
29
|
-
dropdownListId?: string;
|
|
30
|
-
alignDropdownWithToolbar?: boolean;
|
|
31
|
-
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
32
|
-
onMount?: () => void;
|
|
33
|
-
onClick?: () => void;
|
|
34
22
|
footer?: React.ReactNode;
|
|
23
|
+
hideExpandIcon?: boolean;
|
|
24
|
+
icon?: ReactElement<any>;
|
|
25
|
+
iconBefore?: ReactElement<any>;
|
|
26
|
+
mountPoint?: HTMLElement;
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
onMount?: () => void;
|
|
29
|
+
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
30
|
+
options: DropdownOptions<Function> | FloatingToolbarOverflowDropdownOptions<Function> | ExtensionDropdownOptions;
|
|
35
31
|
/** If true, the component will have pulse onboarding effect around it. */
|
|
36
32
|
pulse?: boolean;
|
|
37
|
-
|
|
33
|
+
scrollableElement?: HTMLElement;
|
|
34
|
+
setDisableParentScroll?: (disable: boolean) => void;
|
|
38
35
|
shouldFitContainer?: boolean;
|
|
39
|
-
|
|
36
|
+
showSelected?: boolean;
|
|
37
|
+
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
38
|
+
title: string;
|
|
39
|
+
tooltip?: string;
|
|
40
40
|
}
|
|
41
41
|
export interface State {
|
|
42
42
|
isOpen: boolean;
|
|
@@ -9,23 +9,23 @@ export declare const menuItemDimensions: {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const itemSpacing: number;
|
|
11
11
|
export interface Props {
|
|
12
|
-
hide: Function;
|
|
13
12
|
dispatchCommand: Function;
|
|
13
|
+
editorView?: EditorView;
|
|
14
|
+
hide: Function;
|
|
14
15
|
items: Array<DropdownOptionT<Function>> | FloatingToolbarOverflowDropdownOptions<Function>;
|
|
15
16
|
showSelected?: boolean;
|
|
16
|
-
editorView?: EditorView;
|
|
17
17
|
}
|
|
18
18
|
export type ExtensionProps = {
|
|
19
19
|
extensionApi?: ExtensionAPI;
|
|
20
20
|
extensionProvider?: Promise<ExtensionProvider>;
|
|
21
21
|
};
|
|
22
22
|
export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
23
|
+
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
+
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
25
|
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
-
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
26
|
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
26
27
|
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
27
|
-
|
|
28
|
-
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
28
|
+
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
29
29
|
}
|
|
30
30
|
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
31
31
|
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
@@ -7,14 +7,14 @@ type EmojiPickerButtonReturnType = (props: {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
editorView?: EditorView;
|
|
9
9
|
idx?: number;
|
|
10
|
-
providerFactory?: ProviderFactory;
|
|
11
|
-
title?: string;
|
|
12
|
-
onChange?: (emoji: EmojiId) => void;
|
|
13
10
|
isSelected?: boolean;
|
|
14
11
|
mountPoint?: HTMLElement;
|
|
12
|
+
onChange?: (emoji: EmojiId) => void;
|
|
13
|
+
pluginInjectionApi?: ExtractInjectionAPI<FloatingToolbarPlugin>;
|
|
15
14
|
popupsBoundariesElement?: HTMLElement;
|
|
15
|
+
providerFactory?: ProviderFactory;
|
|
16
16
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
|
-
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => JSX.Element;
|
|
19
19
|
export declare const EmojiPickerButton: EmojiPickerButtonReturnType;
|
|
20
20
|
export {};
|
|
@@ -4,20 +4,20 @@ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface Props {
|
|
7
|
-
|
|
8
|
-
extensionProvider: Promise<ExtensionProvider>;
|
|
9
|
-
editorView: EditorView;
|
|
10
|
-
separator?: 'start' | 'end' | 'both';
|
|
7
|
+
alignDropdownWithToolbar?: boolean;
|
|
11
8
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
12
|
-
extensionApi: ExtensionAPI | undefined;
|
|
13
|
-
scrollable?: boolean;
|
|
14
|
-
setDisableScroll?: (disable: boolean) => void;
|
|
15
9
|
dispatchCommand?: (command: Function) => void;
|
|
16
|
-
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
extensionApi: ExtensionAPI | undefined;
|
|
12
|
+
extensionProvider: Promise<ExtensionProvider>;
|
|
13
|
+
node: PMNode;
|
|
17
14
|
popupsBoundariesElement?: HTMLElement;
|
|
15
|
+
popupsMountPoint?: HTMLElement;
|
|
18
16
|
popupsScrollableElement?: HTMLElement;
|
|
17
|
+
scrollable?: boolean;
|
|
18
|
+
separator?: 'start' | 'end' | 'both';
|
|
19
19
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
20
|
-
|
|
20
|
+
setDisableScroll?: (disable: boolean) => void;
|
|
21
21
|
}
|
|
22
22
|
export declare const ExtensionsPlaceholder: (props: Props) => React.JSX.Element | null;
|
|
23
23
|
export {};
|
package/dist/types/ui/Input.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
export interface Props {
|
|
3
|
-
mountPoint?: HTMLElement;
|
|
4
3
|
boundariesElement?: HTMLElement;
|
|
5
4
|
defaultValue?: string;
|
|
6
|
-
|
|
5
|
+
mountPoint?: HTMLElement;
|
|
7
6
|
onBlur?: (text: string) => void;
|
|
8
7
|
onSubmit?: (text: string) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface State {
|
|
11
11
|
text: string;
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { IntlShape } from 'react-intl-next';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
type ScrollButtonProps = {
|
|
5
|
+
disabled: boolean;
|
|
5
6
|
intl: IntlShape;
|
|
6
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
7
7
|
node: Node;
|
|
8
|
-
|
|
8
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
9
9
|
side: 'left' | 'right';
|
|
10
10
|
};
|
|
11
11
|
export declare const ScrollButton: ({ intl, scrollContainerRef, node, disabled, side, }: ScrollButtonProps) => false | React.JSX.Element;
|
|
@@ -7,10 +7,10 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { IntlShape } from 'react-intl-next';
|
|
8
8
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
interface ScrollButtonsProps {
|
|
10
|
+
disabled: boolean;
|
|
10
11
|
intl: IntlShape;
|
|
11
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
12
12
|
node: Node;
|
|
13
|
-
|
|
13
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
14
14
|
}
|
|
15
15
|
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
16
16
|
export {};
|
|
@@ -2,19 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import type { SelectOption } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { ValueType } from '@atlaskit/select';
|
|
4
4
|
export interface Props {
|
|
5
|
-
|
|
6
|
-
options: SelectOption[];
|
|
7
|
-
dispatchCommand: (command: Function) => void;
|
|
8
|
-
mountPoint?: HTMLElement;
|
|
5
|
+
ariaLabel?: string;
|
|
9
6
|
boundariesElement?: HTMLElement;
|
|
10
|
-
|
|
7
|
+
classNamePrefix?: string;
|
|
11
8
|
defaultValue?: SelectOption | null;
|
|
12
|
-
|
|
13
|
-
onChange?: (change: ValueType<SelectOption>) => void;
|
|
14
|
-
width?: number;
|
|
9
|
+
dispatchCommand: (command: Function) => void;
|
|
15
10
|
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
11
|
+
hideExpandIcon?: boolean;
|
|
12
|
+
mountPoint?: HTMLElement;
|
|
13
|
+
onChange?: (change: ValueType<SelectOption>) => void;
|
|
14
|
+
options: SelectOption[];
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
scrollableElement?: HTMLElement;
|
|
16
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
|
-
|
|
18
|
-
classNamePrefix?: string;
|
|
18
|
+
width?: number;
|
|
19
19
|
}
|
|
20
20
|
export default function Search(props: Props): React.JSX.Element;
|
|
@@ -13,30 +13,30 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
14
|
import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
|
|
15
15
|
export interface Props {
|
|
16
|
-
|
|
16
|
+
api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
17
|
+
className?: string;
|
|
18
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
17
19
|
dispatchCommand: (command?: Function) => void;
|
|
18
|
-
|
|
20
|
+
editorView?: EditorView;
|
|
21
|
+
extensionsProvider?: Promise<ExtensionProvider>;
|
|
22
|
+
focusEditor?: () => void;
|
|
23
|
+
groupLabel?: string;
|
|
24
|
+
items: Array<Item>;
|
|
25
|
+
mediaAssistiveMessage?: string;
|
|
26
|
+
node: Node;
|
|
19
27
|
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
20
29
|
popupsScrollableElement?: HTMLElement;
|
|
21
30
|
providerFactory?: ProviderFactory;
|
|
22
|
-
className?: string;
|
|
23
|
-
groupLabel?: string;
|
|
24
|
-
focusEditor?: () => void;
|
|
25
|
-
editorView?: EditorView;
|
|
26
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
27
|
-
target?: HTMLElement;
|
|
28
|
-
node: Node;
|
|
29
|
-
extensionsProvider?: Promise<ExtensionProvider>;
|
|
30
31
|
scrollable?: boolean;
|
|
31
|
-
api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
32
|
-
mediaAssistiveMessage?: string;
|
|
33
32
|
shouldFitContainer?: boolean;
|
|
33
|
+
target?: HTMLElement;
|
|
34
34
|
}
|
|
35
35
|
type GroupedItems = (Item | Item[])[];
|
|
36
36
|
export declare function groupItems(items: Item[]): GroupedItems;
|
|
37
37
|
export interface State {
|
|
38
|
-
scrollDisabled: boolean;
|
|
39
38
|
mounted: boolean;
|
|
39
|
+
scrollDisabled: boolean;
|
|
40
40
|
}
|
|
41
41
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
42
42
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
@@ -14,8 +14,8 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
14
14
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
15
15
|
export type ConfigWithNodeInfo = {
|
|
16
16
|
config: FloatingToolbarConfig | undefined;
|
|
17
|
-
pos: number;
|
|
18
17
|
node: Node;
|
|
18
|
+
pos: number;
|
|
19
19
|
};
|
|
20
20
|
export type FloatingToolbarPluginState = {
|
|
21
21
|
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
@@ -42,10 +42,10 @@ export type FloatingToolbarPluginDependencies = [
|
|
|
42
42
|
OptionalPlugin<AnalyticsPlugin>
|
|
43
43
|
];
|
|
44
44
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
45
|
-
dependencies: FloatingToolbarPluginDependencies;
|
|
46
45
|
actions: {
|
|
47
46
|
forceFocusSelector: ForceFocusSelector;
|
|
48
47
|
};
|
|
48
|
+
dependencies: FloatingToolbarPluginDependencies;
|
|
49
49
|
sharedState: {
|
|
50
50
|
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
51
51
|
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
@@ -10,33 +10,33 @@ import type { CommandDispatch, DropdownOptions, ExtensionDropdownOptions, Floati
|
|
|
10
10
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
12
12
|
export interface Props {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
iconBefore?: ReactElement<any>;
|
|
16
|
-
hideExpandIcon?: boolean;
|
|
17
|
-
options: DropdownOptions<Function> | FloatingToolbarOverflowDropdownOptions<Function> | ExtensionDropdownOptions;
|
|
18
|
-
dispatchCommand: (command: Function) => void;
|
|
19
|
-
mountPoint?: HTMLElement;
|
|
13
|
+
alignDropdownWithToolbar?: boolean;
|
|
14
|
+
alignX?: 'left' | 'right' | 'center';
|
|
20
15
|
boundariesElement?: HTMLElement;
|
|
21
|
-
scrollableElement?: HTMLElement;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
tooltip?: string;
|
|
24
16
|
buttonTestId?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
dispatchCommand: (command: Function) => void;
|
|
19
|
+
dropdownListId?: string;
|
|
25
20
|
dropdownWidth?: number;
|
|
26
|
-
showSelected?: boolean;
|
|
27
|
-
setDisableParentScroll?: (disable: boolean) => void;
|
|
28
21
|
editorView?: EditorView;
|
|
29
|
-
dropdownListId?: string;
|
|
30
|
-
alignDropdownWithToolbar?: boolean;
|
|
31
|
-
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
32
|
-
onMount?: () => void;
|
|
33
|
-
onClick?: () => void;
|
|
34
22
|
footer?: React.ReactNode;
|
|
23
|
+
hideExpandIcon?: boolean;
|
|
24
|
+
icon?: ReactElement<any>;
|
|
25
|
+
iconBefore?: ReactElement<any>;
|
|
26
|
+
mountPoint?: HTMLElement;
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
onMount?: () => void;
|
|
29
|
+
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
30
|
+
options: DropdownOptions<Function> | FloatingToolbarOverflowDropdownOptions<Function> | ExtensionDropdownOptions;
|
|
35
31
|
/** If true, the component will have pulse onboarding effect around it. */
|
|
36
32
|
pulse?: boolean;
|
|
37
|
-
|
|
33
|
+
scrollableElement?: HTMLElement;
|
|
34
|
+
setDisableParentScroll?: (disable: boolean) => void;
|
|
38
35
|
shouldFitContainer?: boolean;
|
|
39
|
-
|
|
36
|
+
showSelected?: boolean;
|
|
37
|
+
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
38
|
+
title: string;
|
|
39
|
+
tooltip?: string;
|
|
40
40
|
}
|
|
41
41
|
export interface State {
|
|
42
42
|
isOpen: boolean;
|
|
@@ -9,23 +9,23 @@ export declare const menuItemDimensions: {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const itemSpacing: number;
|
|
11
11
|
export interface Props {
|
|
12
|
-
hide: Function;
|
|
13
12
|
dispatchCommand: Function;
|
|
13
|
+
editorView?: EditorView;
|
|
14
|
+
hide: Function;
|
|
14
15
|
items: Array<DropdownOptionT<Function>> | FloatingToolbarOverflowDropdownOptions<Function>;
|
|
15
16
|
showSelected?: boolean;
|
|
16
|
-
editorView?: EditorView;
|
|
17
17
|
}
|
|
18
18
|
export type ExtensionProps = {
|
|
19
19
|
extensionApi?: ExtensionAPI;
|
|
20
20
|
extensionProvider?: Promise<ExtensionProvider>;
|
|
21
21
|
};
|
|
22
22
|
export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
23
|
+
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
+
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
25
|
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
-
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
26
|
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
26
27
|
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
27
|
-
|
|
28
|
-
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
28
|
+
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
29
29
|
}
|
|
30
30
|
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
31
31
|
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
@@ -7,14 +7,14 @@ type EmojiPickerButtonReturnType = (props: {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
editorView?: EditorView;
|
|
9
9
|
idx?: number;
|
|
10
|
-
providerFactory?: ProviderFactory;
|
|
11
|
-
title?: string;
|
|
12
|
-
onChange?: (emoji: EmojiId) => void;
|
|
13
10
|
isSelected?: boolean;
|
|
14
11
|
mountPoint?: HTMLElement;
|
|
12
|
+
onChange?: (emoji: EmojiId) => void;
|
|
13
|
+
pluginInjectionApi?: ExtractInjectionAPI<FloatingToolbarPlugin>;
|
|
15
14
|
popupsBoundariesElement?: HTMLElement;
|
|
15
|
+
providerFactory?: ProviderFactory;
|
|
16
16
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
|
-
|
|
17
|
+
title?: string;
|
|
18
18
|
}) => JSX.Element;
|
|
19
19
|
export declare const EmojiPickerButton: EmojiPickerButtonReturnType;
|
|
20
20
|
export {};
|
|
@@ -4,20 +4,20 @@ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
interface Props {
|
|
7
|
-
|
|
8
|
-
extensionProvider: Promise<ExtensionProvider>;
|
|
9
|
-
editorView: EditorView;
|
|
10
|
-
separator?: 'start' | 'end' | 'both';
|
|
7
|
+
alignDropdownWithToolbar?: boolean;
|
|
11
8
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
12
|
-
extensionApi: ExtensionAPI | undefined;
|
|
13
|
-
scrollable?: boolean;
|
|
14
|
-
setDisableScroll?: (disable: boolean) => void;
|
|
15
9
|
dispatchCommand?: (command: Function) => void;
|
|
16
|
-
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
extensionApi: ExtensionAPI | undefined;
|
|
12
|
+
extensionProvider: Promise<ExtensionProvider>;
|
|
13
|
+
node: PMNode;
|
|
17
14
|
popupsBoundariesElement?: HTMLElement;
|
|
15
|
+
popupsMountPoint?: HTMLElement;
|
|
18
16
|
popupsScrollableElement?: HTMLElement;
|
|
17
|
+
scrollable?: boolean;
|
|
18
|
+
separator?: 'start' | 'end' | 'both';
|
|
19
19
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
20
|
-
|
|
20
|
+
setDisableScroll?: (disable: boolean) => void;
|
|
21
21
|
}
|
|
22
22
|
export declare const ExtensionsPlaceholder: (props: Props) => React.JSX.Element | null;
|
|
23
23
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
export interface Props {
|
|
3
|
-
mountPoint?: HTMLElement;
|
|
4
3
|
boundariesElement?: HTMLElement;
|
|
5
4
|
defaultValue?: string;
|
|
6
|
-
|
|
5
|
+
mountPoint?: HTMLElement;
|
|
7
6
|
onBlur?: (text: string) => void;
|
|
8
7
|
onSubmit?: (text: string) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
9
|
}
|
|
10
10
|
export interface State {
|
|
11
11
|
text: string;
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { IntlShape } from 'react-intl-next';
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
type ScrollButtonProps = {
|
|
5
|
+
disabled: boolean;
|
|
5
6
|
intl: IntlShape;
|
|
6
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
7
7
|
node: Node;
|
|
8
|
-
|
|
8
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
9
9
|
side: 'left' | 'right';
|
|
10
10
|
};
|
|
11
11
|
export declare const ScrollButton: ({ intl, scrollContainerRef, node, disabled, side, }: ScrollButtonProps) => false | React.JSX.Element;
|
|
@@ -7,10 +7,10 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { IntlShape } from 'react-intl-next';
|
|
8
8
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
interface ScrollButtonsProps {
|
|
10
|
+
disabled: boolean;
|
|
10
11
|
intl: IntlShape;
|
|
11
|
-
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
12
12
|
node: Node;
|
|
13
|
-
|
|
13
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
14
14
|
}
|
|
15
15
|
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
16
16
|
export {};
|
|
@@ -2,19 +2,19 @@ import React from 'react';
|
|
|
2
2
|
import type { SelectOption } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { ValueType } from '@atlaskit/select';
|
|
4
4
|
export interface Props {
|
|
5
|
-
|
|
6
|
-
options: SelectOption[];
|
|
7
|
-
dispatchCommand: (command: Function) => void;
|
|
8
|
-
mountPoint?: HTMLElement;
|
|
5
|
+
ariaLabel?: string;
|
|
9
6
|
boundariesElement?: HTMLElement;
|
|
10
|
-
|
|
7
|
+
classNamePrefix?: string;
|
|
11
8
|
defaultValue?: SelectOption | null;
|
|
12
|
-
|
|
13
|
-
onChange?: (change: ValueType<SelectOption>) => void;
|
|
14
|
-
width?: number;
|
|
9
|
+
dispatchCommand: (command: Function) => void;
|
|
15
10
|
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
11
|
+
hideExpandIcon?: boolean;
|
|
12
|
+
mountPoint?: HTMLElement;
|
|
13
|
+
onChange?: (change: ValueType<SelectOption>) => void;
|
|
14
|
+
options: SelectOption[];
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
scrollableElement?: HTMLElement;
|
|
16
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
17
|
-
|
|
18
|
-
classNamePrefix?: string;
|
|
18
|
+
width?: number;
|
|
19
19
|
}
|
|
20
20
|
export default function Search(props: Props): React.JSX.Element;
|
|
@@ -13,30 +13,30 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
14
|
import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
|
|
15
15
|
export interface Props {
|
|
16
|
-
|
|
16
|
+
api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
17
|
+
className?: string;
|
|
18
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
17
19
|
dispatchCommand: (command?: Function) => void;
|
|
18
|
-
|
|
20
|
+
editorView?: EditorView;
|
|
21
|
+
extensionsProvider?: Promise<ExtensionProvider>;
|
|
22
|
+
focusEditor?: () => void;
|
|
23
|
+
groupLabel?: string;
|
|
24
|
+
items: Array<Item>;
|
|
25
|
+
mediaAssistiveMessage?: string;
|
|
26
|
+
node: Node;
|
|
19
27
|
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
20
29
|
popupsScrollableElement?: HTMLElement;
|
|
21
30
|
providerFactory?: ProviderFactory;
|
|
22
|
-
className?: string;
|
|
23
|
-
groupLabel?: string;
|
|
24
|
-
focusEditor?: () => void;
|
|
25
|
-
editorView?: EditorView;
|
|
26
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
27
|
-
target?: HTMLElement;
|
|
28
|
-
node: Node;
|
|
29
|
-
extensionsProvider?: Promise<ExtensionProvider>;
|
|
30
31
|
scrollable?: boolean;
|
|
31
|
-
api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
32
|
-
mediaAssistiveMessage?: string;
|
|
33
32
|
shouldFitContainer?: boolean;
|
|
33
|
+
target?: HTMLElement;
|
|
34
34
|
}
|
|
35
35
|
type GroupedItems = (Item | Item[])[];
|
|
36
36
|
export declare function groupItems(items: Item[]): GroupedItems;
|
|
37
37
|
export interface State {
|
|
38
|
-
scrollDisabled: boolean;
|
|
39
38
|
mounted: boolean;
|
|
39
|
+
scrollDisabled: boolean;
|
|
40
40
|
}
|
|
41
41
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
42
42
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-emoji": "^4.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-extension": "^6.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-interaction": "^5.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-table": "^12.
|
|
40
|
+
"@atlaskit/editor-plugin-table": "^12.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-user-intent": "^1.1.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
43
|
"@atlaskit/emoji": "^69.5.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/primitives": "^14.11.0",
|
|
49
49
|
"@atlaskit/select": "^21.2.0",
|
|
50
50
|
"@atlaskit/theme": "^19.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
52
52
|
"@atlaskit/tokens": "^6.0.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.4.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
@@ -60,12 +60,11 @@
|
|
|
60
60
|
"react-loadable": "^5.1.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^107.
|
|
63
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
64
64
|
"react": "^18.2.0",
|
|
65
65
|
"react-dom": "^18.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
69
68
|
"@testing-library/dom": "^10.1.0",
|
|
70
69
|
"@testing-library/react": "^13.4.0",
|
|
71
70
|
"@testing-library/user-event": "^14.4.3",
|