@atlaskit/editor-plugin-floating-toolbar 0.6.3 → 0.7.0
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 +16 -0
- package/dist/cjs/ui/Dropdown.js +7 -0
- package/dist/cjs/ui/Toolbar.js +2 -1
- package/dist/es2019/ui/Dropdown.js +7 -0
- package/dist/es2019/ui/Toolbar.js +2 -1
- package/dist/esm/ui/Dropdown.js +7 -0
- package/dist/esm/ui/Toolbar.js +2 -1
- package/dist/types/ui/Dropdown.d.ts +3 -1
- package/dist/types-ts4.5/index.d.ts +2 -0
- package/dist/types-ts4.5/plugin.d.ts +12 -0
- package/dist/types-ts4.5/pm-plugins/force-focus/index.d.ts +21 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/commands.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/plugin.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/reducer.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/toolbar-data/types.d.ts +8 -0
- package/dist/types-ts4.5/types.d.ts +42 -0
- package/dist/types-ts4.5/ui/CheckboxModal.d.ts +4 -0
- package/dist/types-ts4.5/ui/ConfirmationModal.d.ts +6 -0
- package/dist/types-ts4.5/ui/Dropdown.d.ts +43 -0
- package/dist/types-ts4.5/ui/DropdownMenu.d.ts +29 -0
- package/dist/types-ts4.5/ui/EditorEmojiAddIcon.d.ts +2 -0
- package/dist/types-ts4.5/ui/EmojiPickerButton.d.ts +16 -0
- package/dist/types-ts4.5/ui/ExtensionsPlaceholder.d.ts +16 -0
- package/dist/types-ts4.5/ui/Input.d.ts +23 -0
- package/dist/types-ts4.5/ui/ScrollButtons.d.ts +13 -0
- package/dist/types-ts4.5/ui/Select.d.ts +21 -0
- package/dist/types-ts4.5/ui/Separator.d.ts +2 -0
- package/dist/types-ts4.5/ui/SimpleModal.d.ts +4 -0
- package/dist/types-ts4.5/ui/Toolbar.d.ts +44 -0
- package/dist/types-ts4.5/ui/ToolbarLoader.d.ts +4 -0
- package/dist/types-ts4.5/ui/messages.d.ts +48 -0
- package/dist/types-ts4.5/ui/styles.d.ts +20 -0
- package/dist/types-ts4.5/utils.d.ts +2 -0
- package/package.json +6 -6
- package/tmp/api-report-tmp.d.ts +64 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#39920](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39920) [`c08ab6beb65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c08ab6beb65) - [ux] Adding new plugin for paste options toolbar. Also making required changes for the new toolbar in folating-toolbar plugin and paste plugin.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 0.6.4
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 0.6.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -77,6 +77,13 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
isOpen: !_this.state.isOpen,
|
|
78
78
|
isOpenedByKeyboard: false
|
|
79
79
|
});
|
|
80
|
+
var onToggle = _this.props.onToggle;
|
|
81
|
+
if (!onToggle) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
requestAnimationFrame(function () {
|
|
85
|
+
_this.props.dispatchCommand(onToggle);
|
|
86
|
+
});
|
|
80
87
|
});
|
|
81
88
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpenByKeyboard", function (event) {
|
|
82
89
|
if (event.key === 'Enter' || event.key === ' ') {
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -151,7 +151,8 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
151
151
|
editorView: editorView,
|
|
152
152
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
153
153
|
dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && "".concat(item.id, "-dropdownList"),
|
|
154
|
-
alignDropdownWithToolbar: items.length === 1
|
|
154
|
+
alignDropdownWithToolbar: items.length === 1,
|
|
155
|
+
onToggle: item.onToggle
|
|
155
156
|
});
|
|
156
157
|
case 'select':
|
|
157
158
|
if (item.selectType === 'list') {
|
|
@@ -54,6 +54,13 @@ export default class Dropdown extends Component {
|
|
|
54
54
|
isOpen: !this.state.isOpen,
|
|
55
55
|
isOpenedByKeyboard: false
|
|
56
56
|
});
|
|
57
|
+
const onToggle = this.props.onToggle;
|
|
58
|
+
if (!onToggle) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
requestAnimationFrame(() => {
|
|
62
|
+
this.props.dispatchCommand(onToggle);
|
|
63
|
+
});
|
|
57
64
|
});
|
|
58
65
|
_defineProperty(this, "toggleOpenByKeyboard", event => {
|
|
59
66
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -119,7 +119,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
119
119
|
editorView: editorView,
|
|
120
120
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
121
121
|
dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && `${item.id}-dropdownList`,
|
|
122
|
-
alignDropdownWithToolbar: items.length === 1
|
|
122
|
+
alignDropdownWithToolbar: items.length === 1,
|
|
123
|
+
onToggle: item.onToggle
|
|
123
124
|
});
|
|
124
125
|
case 'select':
|
|
125
126
|
if (item.selectType === 'list') {
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -69,6 +69,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
69
69
|
isOpen: !_this.state.isOpen,
|
|
70
70
|
isOpenedByKeyboard: false
|
|
71
71
|
});
|
|
72
|
+
var onToggle = _this.props.onToggle;
|
|
73
|
+
if (!onToggle) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
requestAnimationFrame(function () {
|
|
77
|
+
_this.props.dispatchCommand(onToggle);
|
|
78
|
+
});
|
|
72
79
|
});
|
|
73
80
|
_defineProperty(_assertThisInitialized(_this), "toggleOpenByKeyboard", function (event) {
|
|
74
81
|
if (event.key === 'Enter' || event.key === ' ') {
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -142,7 +142,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
142
142
|
editorView: editorView,
|
|
143
143
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
144
144
|
dropdownListId: (item === null || item === void 0 ? void 0 : item.id) && "".concat(item.id, "-dropdownList"),
|
|
145
|
-
alignDropdownWithToolbar: items.length === 1
|
|
145
|
+
alignDropdownWithToolbar: items.length === 1,
|
|
146
|
+
onToggle: item.onToggle
|
|
146
147
|
});
|
|
147
148
|
case 'select':
|
|
148
149
|
if (item.selectType === 'list') {
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import type { DropdownOptions } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { CommandDispatch, DropdownOptions } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
8
|
export interface Props {
|
|
8
9
|
title: string;
|
|
@@ -22,6 +23,7 @@ export interface Props {
|
|
|
22
23
|
editorView?: EditorView;
|
|
23
24
|
dropdownListId?: string;
|
|
24
25
|
alignDropdownWithToolbar?: boolean;
|
|
26
|
+
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
25
27
|
}
|
|
26
28
|
export interface State {
|
|
27
29
|
isOpen: boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './types';
|
|
5
|
+
export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
|
|
6
|
+
export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* ProseMirror Plugin
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare const pluginKey: PluginKey<FloatingToolbarPluginState>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
export declare const forceFocusStateKey: PluginKey<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Used in cases where a floating toolbar button opens a submenu which destroys
|
|
8
|
+
* the button, but the user has pressed ESC to close the submenu and focus needs
|
|
9
|
+
* to move back to the button. */
|
|
10
|
+
declare const _default: () => SafePlugin<{
|
|
11
|
+
selector: null;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
/**
|
|
15
|
+
* The provided selector should be the floating toolbar button that needs focus.
|
|
16
|
+
*/
|
|
17
|
+
export declare const forceFocusSelector: (selector: string | null) => (tr: Transaction) => Transaction;
|
|
18
|
+
/**
|
|
19
|
+
* If a selector is set and the element exists, focus it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkShouldForceFocusAndApply(view?: EditorView): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("../..").FloatingToolbarPluginData | ((state: import("prosemirror-state").EditorState) => import("../..").FloatingToolbarPluginData)) => import("prosemirror-state").SafeStateField<import("../..").FloatingToolbarPluginData>, createCommand: <A = import("./types").FloatingToolbarPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../..").FloatingToolbarPluginData;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
3
|
+
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
4
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
6
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
7
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
8
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
export type ConfigWithNodeInfo = {
|
|
11
|
+
config: FloatingToolbarConfig | undefined;
|
|
12
|
+
pos: number;
|
|
13
|
+
node: Node;
|
|
14
|
+
};
|
|
15
|
+
export type FloatingToolbarPluginState = {
|
|
16
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type FloatingToolbarPluginData = {
|
|
19
|
+
confirmDialogForItem?: number;
|
|
20
|
+
};
|
|
21
|
+
export type ForceFocusSelector = (selector: string | null) => (tr: Transaction) => Transaction;
|
|
22
|
+
/**
|
|
23
|
+
* Floating toolbar plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
24
|
+
* from `@atlaskit/editor-core`.
|
|
25
|
+
*/
|
|
26
|
+
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
27
|
+
dependencies: [
|
|
28
|
+
FeatureFlagsPlugin,
|
|
29
|
+
DecorationsPlugin,
|
|
30
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
31
|
+
OptionalPlugin<ExtensionPlugin>,
|
|
32
|
+
CopyButtonPlugin,
|
|
33
|
+
EditorDisabledPlugin
|
|
34
|
+
];
|
|
35
|
+
actions: {
|
|
36
|
+
forceFocusSelector: ForceFocusSelector;
|
|
37
|
+
};
|
|
38
|
+
sharedState: {
|
|
39
|
+
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
40
|
+
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const CheckboxModal: (props: ConfirmationDialogProps & WrappedComponentProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const ConfirmationModal: React.FC<import("react-intl-next").WithIntlProps<ConfirmationDialogProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<ConfirmationDialogProps & WrappedComponentProps<"intl">>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import type { CommandDispatch, DropdownOptions } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
export interface Props {
|
|
9
|
+
title: string;
|
|
10
|
+
icon?: ReactElement<any>;
|
|
11
|
+
hideExpandIcon?: boolean;
|
|
12
|
+
options: DropdownOptions<Function>;
|
|
13
|
+
dispatchCommand: (command: Function) => void;
|
|
14
|
+
mountPoint?: HTMLElement;
|
|
15
|
+
boundariesElement?: HTMLElement;
|
|
16
|
+
scrollableElement?: HTMLElement;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
tooltip?: string;
|
|
19
|
+
buttonTestId?: string;
|
|
20
|
+
dropdownWidth?: number;
|
|
21
|
+
showSelected?: boolean;
|
|
22
|
+
setDisableParentScroll?: (disable: boolean) => void;
|
|
23
|
+
editorView?: EditorView;
|
|
24
|
+
dropdownListId?: string;
|
|
25
|
+
alignDropdownWithToolbar?: boolean;
|
|
26
|
+
onToggle?: (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface State {
|
|
29
|
+
isOpen: boolean;
|
|
30
|
+
isOpenedByKeyboard: boolean;
|
|
31
|
+
}
|
|
32
|
+
export default class Dropdown extends Component<Props, State> {
|
|
33
|
+
state: State;
|
|
34
|
+
triggerRef: React.RefObject<HTMLDivElement>;
|
|
35
|
+
render(): jsx.JSX.Element;
|
|
36
|
+
private renderArrayOptions;
|
|
37
|
+
private toggleOpen;
|
|
38
|
+
private toggleOpenByKeyboard;
|
|
39
|
+
private hide;
|
|
40
|
+
private hideOnEsc;
|
|
41
|
+
private onOpenChanged;
|
|
42
|
+
componentDidUpdate(prevProps: Props, prevState: State): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { DropdownOptionT } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { ButtonItemProps } from '@atlaskit/menu';
|
|
6
|
+
export declare const menuItemDimensions: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const itemSpacing: number;
|
|
11
|
+
export interface Props {
|
|
12
|
+
hide: Function;
|
|
13
|
+
dispatchCommand: Function;
|
|
14
|
+
items: Array<DropdownOptionT<Function>>;
|
|
15
|
+
showSelected?: boolean;
|
|
16
|
+
editorView?: EditorView;
|
|
17
|
+
}
|
|
18
|
+
export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
19
|
+
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
|
+
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
21
|
+
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
22
|
+
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
|
+
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
|
+
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
27
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
+
import type { EmojiId } from '@atlaskit/emoji';
|
|
6
|
+
export declare const EmojiPickerButton: React.FunctionComponent<{
|
|
7
|
+
className?: string;
|
|
8
|
+
editorView?: EditorView;
|
|
9
|
+
idx?: number;
|
|
10
|
+
providerFactory?: ProviderFactory;
|
|
11
|
+
title?: string;
|
|
12
|
+
onChange?: (emoji: EmojiId) => void;
|
|
13
|
+
isSelected?: boolean;
|
|
14
|
+
mountPoint?: HTMLElement;
|
|
15
|
+
setDisableParentScroll?: (disable: boolean) => void;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
|
|
4
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
5
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
interface Props {
|
|
8
|
+
node: PMNode;
|
|
9
|
+
extensionProvider: Promise<ExtensionProvider>;
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
separator?: 'start' | 'end' | 'both';
|
|
12
|
+
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
13
|
+
extensionApi: ExtensionAPI | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const ExtensionsPlaceholder: (props: Props) => JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
export interface Props {
|
|
6
|
+
mountPoint?: HTMLElement;
|
|
7
|
+
boundariesElement?: HTMLElement;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
onBlur?: (text: string) => void;
|
|
11
|
+
onSubmit?: (text: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface State {
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
export default class TextField extends Component<Props, State> {
|
|
17
|
+
constructor(props: Props);
|
|
18
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
19
|
+
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
handleSubmit: (e: React.FormEvent) => void;
|
|
21
|
+
handleBlur: (e: React.FocusEvent<{}>) => void;
|
|
22
|
+
render(): jsx.JSX.Element;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import type { IntlShape } from 'react-intl-next';
|
|
5
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
interface ScrollButtonsProps {
|
|
7
|
+
intl: IntlShape;
|
|
8
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
9
|
+
node: Node;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled, }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { RenderOptionsPropsT, SelectOption } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ValueType } from '@atlaskit/select';
|
|
4
|
+
export type { RenderOptionsPropsT, SelectOption };
|
|
5
|
+
export interface Props {
|
|
6
|
+
hideExpandIcon?: boolean;
|
|
7
|
+
options: SelectOption[];
|
|
8
|
+
dispatchCommand: (command: Function) => void;
|
|
9
|
+
mountPoint?: HTMLElement;
|
|
10
|
+
boundariesElement?: HTMLElement;
|
|
11
|
+
scrollableElement?: HTMLElement;
|
|
12
|
+
defaultValue?: SelectOption | null;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
onChange?: (change: ValueType<SelectOption>) => void;
|
|
15
|
+
width?: number;
|
|
16
|
+
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
17
|
+
setDisableParentScroll?: (disable: boolean) => void;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
classNamePrefix?: string;
|
|
20
|
+
}
|
|
21
|
+
export default function Search(props: Props): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare const SimpleModal: (props: ConfirmationDialogProps & WrappedComponentProps) => JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
|
+
import type { Item } from '@atlaskit/editor-common/floating-toolbar';
|
|
7
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
8
|
+
import type { FeatureFlags, OptionalPlugin, PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
10
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
12
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
+
export type { Item };
|
|
15
|
+
export interface Props {
|
|
16
|
+
items: Array<Item>;
|
|
17
|
+
dispatchCommand: (command?: Function) => void;
|
|
18
|
+
popupsMountPoint?: HTMLElement;
|
|
19
|
+
popupsBoundariesElement?: HTMLElement;
|
|
20
|
+
popupsScrollableElement?: HTMLElement;
|
|
21
|
+
providerFactory?: ProviderFactory;
|
|
22
|
+
className?: string;
|
|
23
|
+
focusEditor?: () => void;
|
|
24
|
+
editorView?: EditorView;
|
|
25
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
26
|
+
target?: HTMLElement;
|
|
27
|
+
node: Node;
|
|
28
|
+
extensionsProvider?: Promise<ExtensionProvider>;
|
|
29
|
+
scrollable?: boolean;
|
|
30
|
+
featureFlags: FeatureFlags;
|
|
31
|
+
api: PluginInjectionAPIWithDependencies<[
|
|
32
|
+
typeof decorationsPlugin,
|
|
33
|
+
OptionalPlugin<typeof contextPanelPlugin>,
|
|
34
|
+
OptionalPlugin<ExtensionPlugin>
|
|
35
|
+
]> | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface State {
|
|
38
|
+
scrollDisabled: boolean;
|
|
39
|
+
mounted: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
42
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
confirmModalDefaultHeading: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
confirmModalOK: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
confirmModalCancel: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
confirmModalListUnit: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
confirmDeleteLinkedModalMessage: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
floatingToolbarAriaLabel: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
floatingToolbarAnnouncer: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
floatingToolbarScrollLeft: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
floatingToolbarScrollRight: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const iconOnlySpacing: {
|
|
2
|
+
'&&': {
|
|
3
|
+
padding: string;
|
|
4
|
+
/**
|
|
5
|
+
Increased specificity here because css for .hyperlink-open-link defined in
|
|
6
|
+
packages/editor/editor-core/src/ui/ContentStyles/index.tsx file
|
|
7
|
+
overrides padding left-right 2px with 4px.
|
|
8
|
+
*/
|
|
9
|
+
'&&[href]': {
|
|
10
|
+
padding: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
'& > span': {
|
|
14
|
+
margin: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare const getButtonStyles: (props: any) => {
|
|
18
|
+
background: any;
|
|
19
|
+
color: any;
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
27
|
-
"@atlaskit/button": "^16.
|
|
27
|
+
"@atlaskit/button": "^16.11.0",
|
|
28
28
|
"@atlaskit/checkbox": "^12.6.0",
|
|
29
|
-
"@atlaskit/editor-common": "^76.
|
|
29
|
+
"@atlaskit/editor-common": "^76.14.0",
|
|
30
30
|
"@atlaskit/editor-palette": "1.5.1",
|
|
31
31
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
32
32
|
"@atlaskit/editor-plugin-copy-button": "^1.0.0",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-table": "^5.
|
|
37
|
+
"@atlaskit/editor-plugin-table": "^5.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/emoji": "^67.5.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|
|
41
|
-
"@atlaskit/menu": "^1.
|
|
41
|
+
"@atlaskit/menu": "^2.1.0",
|
|
42
42
|
"@atlaskit/modal-dialog": "^12.8.0",
|
|
43
43
|
"@atlaskit/select": "^16.7.0",
|
|
44
44
|
"@atlaskit/theme": "^12.6.0",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
46
46
|
"@atlaskit/tooltip": "^17.8.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-floating-toolbar"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
8
|
+
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
9
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
10
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
11
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
13
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
14
|
+
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
15
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
16
|
+
import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
|
|
17
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
18
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
19
|
+
|
|
20
|
+
// @public (undocumented)
|
|
21
|
+
export type ConfigWithNodeInfo = {
|
|
22
|
+
config: FloatingToolbarConfig | undefined;
|
|
23
|
+
pos: number;
|
|
24
|
+
node: Node_2;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// @public
|
|
28
|
+
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
29
|
+
dependencies: [
|
|
30
|
+
FeatureFlagsPlugin,
|
|
31
|
+
DecorationsPlugin,
|
|
32
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
33
|
+
OptionalPlugin<ExtensionPlugin>,
|
|
34
|
+
CopyButtonPlugin,
|
|
35
|
+
EditorDisabledPlugin
|
|
36
|
+
];
|
|
37
|
+
actions: {
|
|
38
|
+
forceFocusSelector: ForceFocusSelector;
|
|
39
|
+
};
|
|
40
|
+
sharedState: undefined | {
|
|
41
|
+
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
42
|
+
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
|
|
46
|
+
// @public (undocumented)
|
|
47
|
+
export const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
48
|
+
|
|
49
|
+
// @public (undocumented)
|
|
50
|
+
export type FloatingToolbarPluginData = {
|
|
51
|
+
confirmDialogForItem?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// @public (undocumented)
|
|
55
|
+
export type FloatingToolbarPluginState = {
|
|
56
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// @public (undocumented)
|
|
60
|
+
export type ForceFocusSelector = (selector: null | string) => (tr: Transaction) => Transaction;
|
|
61
|
+
|
|
62
|
+
// (No @packageDocumentation comment for this package)
|
|
63
|
+
|
|
64
|
+
```
|