@atlaskit/editor-plugin-insert-block 4.3.1 → 4.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/types/insertBlockPluginType.d.ts +2 -2
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/ui/ElementBrowser/types.d.ts +3 -3
- package/dist/types/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +8 -8
- package/dist/types/ui/ToolbarInsertBlock/block-insert-menu.d.ts +12 -12
- package/dist/types/ui/ToolbarInsertBlock/create-items.d.ts +24 -24
- package/dist/types/ui/ToolbarInsertBlock/dropdown-button.d.ts +4 -4
- package/dist/types/ui/ToolbarInsertBlock/index.d.ts +1 -1
- package/dist/types/ui/ToolbarInsertBlock/item.d.ts +2 -2
- package/dist/types/ui/ToolbarInsertBlock/types.d.ts +36 -36
- package/dist/types-ts4.5/insertBlockPluginType.d.ts +2 -2
- package/dist/types-ts4.5/types/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +3 -3
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +8 -8
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/block-insert-menu.d.ts +12 -12
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/create-items.d.ts +24 -24
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/dropdown-button.d.ts +4 -4
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/item.d.ts +2 -2
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/types.d.ts +36 -36
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 4.3.3
|
|
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
|
+
## 4.3.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 4.3.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { InsertBlockPluginOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
|
|
3
3
|
export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
|
|
4
|
-
pluginConfiguration: InsertBlockPluginOptions | undefined;
|
|
5
|
-
dependencies: InsertBlockPluginDependencies;
|
|
6
4
|
actions: {
|
|
7
5
|
toggleAdditionalMenu: () => void;
|
|
8
6
|
};
|
|
7
|
+
dependencies: InsertBlockPluginDependencies;
|
|
8
|
+
pluginConfiguration: InsertBlockPluginOptions | undefined;
|
|
9
9
|
sharedState: InsertBlockPluginState | undefined;
|
|
10
10
|
}>;
|
|
@@ -56,10 +56,11 @@ export type InsertBlockPluginDependencies = [
|
|
|
56
56
|
OptionalPlugin<ToolbarPlugin>
|
|
57
57
|
];
|
|
58
58
|
export interface InsertBlockPluginOptions {
|
|
59
|
-
allowTables?: boolean;
|
|
60
59
|
allowExpand?: boolean;
|
|
61
|
-
|
|
60
|
+
allowTables?: boolean;
|
|
61
|
+
appearance?: EditorAppearance;
|
|
62
62
|
horizontalRuleEnabled?: boolean;
|
|
63
|
+
insertMenuItems?: any;
|
|
63
64
|
nativeStatusSupported?: boolean;
|
|
64
65
|
/**
|
|
65
66
|
* To hide the element browser "view more" button in the
|
|
@@ -68,7 +69,6 @@ export interface InsertBlockPluginOptions {
|
|
|
68
69
|
*/
|
|
69
70
|
showElementBrowserLink?: boolean;
|
|
70
71
|
tableSelectorSupported?: boolean;
|
|
71
|
-
appearance?: EditorAppearance;
|
|
72
72
|
/**
|
|
73
73
|
* To hide the individual insert block buttons in the toolbar
|
|
74
74
|
* and only show the plus button
|
|
@@ -8,11 +8,11 @@ type SimpleEventHandler<T> = (event?: T) => void;
|
|
|
8
8
|
export interface InsertMenuProps {
|
|
9
9
|
dropdownItems: BlockMenuItem[];
|
|
10
10
|
editorView: EditorView;
|
|
11
|
-
|
|
12
|
-
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
13
12
|
onInsert: OnInsert;
|
|
14
13
|
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
15
|
-
|
|
14
|
+
showElementBrowserLink: boolean;
|
|
15
|
+
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
16
16
|
}
|
|
17
17
|
export type SvgGetterParams = {
|
|
18
18
|
name: string;
|
|
@@ -8,22 +8,22 @@ type SimpleEventHandler<T> = (event?: T) => void;
|
|
|
8
8
|
export interface BlockInsertElementBrowserProps {
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
editorView: EditorView;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
11
12
|
items: BlockMenuItem[];
|
|
12
|
-
spacing: 'none' | 'default';
|
|
13
13
|
label: string;
|
|
14
|
+
onClick: React.MouseEventHandler;
|
|
15
|
+
onInsert: OnInsert;
|
|
16
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
17
|
+
onRef(el: HTMLElement): void;
|
|
14
18
|
open: boolean;
|
|
19
|
+
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
20
|
+
plusButtonRef?: HTMLElement;
|
|
15
21
|
popupsBoundariesElement?: HTMLElement;
|
|
16
22
|
popupsMountPoint?: HTMLElement;
|
|
17
23
|
popupsScrollableElement?: HTMLElement;
|
|
18
|
-
plusButtonRef?: HTMLElement;
|
|
19
24
|
showElementBrowserLink: boolean;
|
|
20
|
-
|
|
21
|
-
onClick: React.MouseEventHandler;
|
|
22
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
23
|
-
onInsert: OnInsert;
|
|
25
|
+
spacing: 'none' | 'default';
|
|
24
26
|
togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
25
|
-
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
26
|
-
isFullPageAppearance?: boolean;
|
|
27
27
|
}
|
|
28
28
|
export declare const BlockInsertElementBrowser: (props: BlockInsertElementBrowserProps) => React.JSX.Element;
|
|
29
29
|
export {};
|
|
@@ -8,26 +8,26 @@ import type { BlockMenuItem } from './create-items';
|
|
|
8
8
|
export interface BlockInsertMenuProps {
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
editorView: EditorView;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
11
12
|
items: BlockMenuItem[];
|
|
12
13
|
label: string;
|
|
14
|
+
onClick: React.MouseEventHandler;
|
|
15
|
+
onInsert: OnInsert;
|
|
16
|
+
onItemActivated?: (attrs: {
|
|
17
|
+
item: MenuItem;
|
|
18
|
+
}) => void;
|
|
19
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
20
|
+
onOpenChange?: (attrs: any) => void;
|
|
21
|
+
onPlusButtonRef(el: HTMLElement): void;
|
|
22
|
+
onRef(el: HTMLElement): void;
|
|
13
23
|
open: boolean;
|
|
24
|
+
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
14
25
|
plusButtonRef?: HTMLElement;
|
|
15
26
|
popupsBoundariesElement?: HTMLElement;
|
|
16
27
|
popupsMountPoint?: HTMLElement;
|
|
17
28
|
popupsScrollableElement?: HTMLElement;
|
|
18
|
-
spacing: 'none' | 'default';
|
|
19
29
|
showElementBrowserLink: boolean;
|
|
20
|
-
|
|
21
|
-
onPlusButtonRef(el: HTMLElement): void;
|
|
22
|
-
onClick: React.MouseEventHandler;
|
|
23
|
-
onItemActivated?: (attrs: {
|
|
24
|
-
item: MenuItem;
|
|
25
|
-
}) => void;
|
|
26
|
-
onInsert: OnInsert;
|
|
27
|
-
onOpenChange?: (attrs: any) => void;
|
|
30
|
+
spacing: 'none' | 'default';
|
|
28
31
|
togglePlusMenuVisibility(): void;
|
|
29
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
30
|
-
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
31
|
-
isFullPageAppearance?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const BlockInsertMenu: (props: BlockInsertMenuProps) => React.JSX.Element | null;
|
|
@@ -4,38 +4,38 @@ import type { BlockType } from '@atlaskit/editor-plugin-block-type';
|
|
|
4
4
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
6
6
|
export interface CreateItemsConfig {
|
|
7
|
-
isTypeAheadAllowed?: boolean;
|
|
8
|
-
tableSupported?: boolean;
|
|
9
|
-
tableSelectorSupported?: boolean;
|
|
10
|
-
mediaUploadsEnabled?: boolean;
|
|
11
|
-
mediaSupported?: boolean;
|
|
12
|
-
imageUploadSupported?: boolean;
|
|
13
|
-
imageUploadEnabled?: boolean;
|
|
14
|
-
mentionsSupported?: boolean;
|
|
15
|
-
mentionsDisabled?: boolean;
|
|
16
|
-
availableWrapperBlockTypes?: BlockType[];
|
|
17
7
|
actionSupported?: boolean;
|
|
8
|
+
availableWrapperBlockTypes?: BlockType[];
|
|
9
|
+
dateEnabled?: boolean;
|
|
18
10
|
decisionSupported?: boolean;
|
|
19
|
-
linkSupported?: boolean;
|
|
20
|
-
linkDisabled?: boolean;
|
|
21
11
|
emojiDisabled?: boolean;
|
|
12
|
+
emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
|
|
13
|
+
expandEnabled?: boolean;
|
|
14
|
+
formatMessage: WrappedComponentProps['intl']['formatMessage'];
|
|
22
15
|
hasEmojiPlugin?: boolean;
|
|
23
|
-
hasMentionsPlugin?: boolean;
|
|
24
16
|
hasMediaPlugin?: boolean;
|
|
25
|
-
|
|
26
|
-
dateEnabled?: boolean;
|
|
27
|
-
placeholderTextEnabled?: boolean;
|
|
17
|
+
hasMentionsPlugin?: boolean;
|
|
28
18
|
horizontalRuleEnabled?: boolean;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
expandEnabled?: boolean;
|
|
19
|
+
imageUploadEnabled?: boolean;
|
|
20
|
+
imageUploadSupported?: boolean;
|
|
32
21
|
insertMenuItems?: MenuItem[];
|
|
33
|
-
emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
|
|
34
|
-
schema: Schema;
|
|
35
|
-
numberOfButtons: number;
|
|
36
|
-
formatMessage: WrappedComponentProps['intl']['formatMessage'];
|
|
37
|
-
isNewMenuEnabled?: boolean;
|
|
38
22
|
isEditorOffline?: boolean;
|
|
23
|
+
isNewMenuEnabled?: boolean;
|
|
24
|
+
isTypeAheadAllowed?: boolean;
|
|
25
|
+
layoutSectionEnabled?: boolean;
|
|
26
|
+
linkDisabled?: boolean;
|
|
27
|
+
linkSupported?: boolean;
|
|
28
|
+
mediaSupported?: boolean;
|
|
29
|
+
mediaUploadsEnabled?: boolean;
|
|
30
|
+
mentionsDisabled?: boolean;
|
|
31
|
+
mentionsSupported?: boolean;
|
|
32
|
+
nativeStatusSupported?: boolean;
|
|
33
|
+
numberOfButtons: number;
|
|
34
|
+
placeholderTextEnabled?: boolean;
|
|
35
|
+
schema: Schema;
|
|
36
|
+
showElementBrowserLink?: boolean;
|
|
37
|
+
tableSelectorSupported?: boolean;
|
|
38
|
+
tableSupported?: boolean;
|
|
39
39
|
}
|
|
40
40
|
export interface BlockMenuItem extends MenuItem {
|
|
41
41
|
title: JSX.Element | null;
|
|
@@ -6,15 +6,15 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
export interface DropDownButtonProps {
|
|
9
|
-
label: string;
|
|
10
|
-
selected: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
9
|
'aria-expanded': React.AriaAttributes['aria-expanded'];
|
|
13
10
|
'aria-haspopup': React.AriaAttributes['aria-haspopup'];
|
|
14
11
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
handleRef(el: ToolbarButtonRef): void;
|
|
14
|
+
label: string;
|
|
15
15
|
onClick: React.MouseEventHandler;
|
|
16
16
|
onKeyDown?: React.KeyboardEventHandler;
|
|
17
|
+
selected: boolean;
|
|
17
18
|
spacing: 'none' | 'default';
|
|
18
|
-
handleRef(el: ToolbarButtonRef): void;
|
|
19
19
|
}
|
|
20
20
|
export declare const DropDownButton: React.MemoExoticComponent<(props: DropDownButtonProps) => jsx.JSX.Element>;
|
|
@@ -7,8 +7,8 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import type { Props, State } from './types';
|
|
9
9
|
export declare const tableButtonWrapper: ({ isTableSelectorOpen, isButtonDisabled, }: {
|
|
10
|
-
isTableSelectorOpen: boolean;
|
|
11
10
|
isButtonDisabled: boolean | undefined;
|
|
11
|
+
isTableSelectorOpen: boolean;
|
|
12
12
|
}) => import("@emotion/react").SerializedStyles;
|
|
13
13
|
export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps, State> {
|
|
14
14
|
private dropdownButtonRef?;
|
|
@@ -6,11 +6,11 @@ import React from 'react';
|
|
|
6
6
|
import type { MemoizedFn } from 'memoize-one';
|
|
7
7
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
export interface CreateInit {
|
|
9
|
+
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
10
|
+
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
9
11
|
content: string;
|
|
10
12
|
disabled: boolean;
|
|
11
13
|
tooltipDescription?: string;
|
|
12
|
-
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
13
|
-
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
14
14
|
}
|
|
15
15
|
export declare const action: MemoizedFn<(init: CreateInit) => MenuItem>;
|
|
16
16
|
export declare const link: MemoizedFn<(init: CreateInit) => MenuItem>;
|
|
@@ -9,58 +9,58 @@ import type { EmojiProvider } from '@atlaskit/emoji';
|
|
|
9
9
|
import type { InsertBlockPlugin } from '../../index';
|
|
10
10
|
import type { BlockMenuItem } from './create-items';
|
|
11
11
|
export interface Props {
|
|
12
|
-
buttons: number;
|
|
13
|
-
showElementBrowser: boolean;
|
|
14
|
-
isReducedSpacing: boolean;
|
|
15
|
-
isDisabled?: boolean;
|
|
16
|
-
isTypeAheadAllowed?: boolean;
|
|
17
|
-
editorView: EditorView;
|
|
18
|
-
editorActions?: EditorActions;
|
|
19
|
-
tableSupported?: boolean;
|
|
20
|
-
tableSelectorSupported?: boolean;
|
|
21
12
|
actionSupported?: boolean;
|
|
13
|
+
availableWrapperBlockTypes?: BlockType[];
|
|
14
|
+
buttons: number;
|
|
15
|
+
dateEnabled?: boolean;
|
|
22
16
|
decisionSupported?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
18
|
+
editorActions?: EditorActions;
|
|
19
|
+
editorAppearance?: EditorAppearance;
|
|
20
|
+
editorView: EditorView;
|
|
21
|
+
emojiDisabled?: boolean;
|
|
22
|
+
emojiProvider?: Promise<EmojiProvider>;
|
|
23
|
+
expandEnabled?: boolean;
|
|
29
24
|
handleImageUpload?: (event?: ImageUploadPluginReferenceEvent) => Command;
|
|
30
|
-
dateEnabled?: boolean;
|
|
31
25
|
horizontalRuleEnabled?: boolean;
|
|
32
|
-
|
|
26
|
+
imageUploadEnabled?: boolean;
|
|
27
|
+
imageUploadSupported?: boolean;
|
|
28
|
+
insertMenuItems?: MenuItem[];
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
isEditorOffline?: boolean;
|
|
31
|
+
isReducedSpacing: boolean;
|
|
32
|
+
isTypeAheadAllowed?: boolean;
|
|
33
33
|
layoutSectionEnabled?: boolean;
|
|
34
|
-
expandEnabled?: boolean;
|
|
35
|
-
emojiProvider?: Promise<EmojiProvider>;
|
|
36
|
-
availableWrapperBlockTypes?: BlockType[];
|
|
37
|
-
linkSupported?: boolean;
|
|
38
34
|
linkDisabled?: boolean;
|
|
39
|
-
|
|
35
|
+
linkSupported?: boolean;
|
|
36
|
+
mediaSupported?: boolean;
|
|
37
|
+
mediaUploadsEnabled?: boolean;
|
|
38
|
+
mentionsDisabled?: boolean;
|
|
39
|
+
mentionsSupported?: boolean;
|
|
40
40
|
nativeStatusSupported?: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
popupsScrollableElement?: HTMLElement;
|
|
44
|
-
insertMenuItems?: MenuItem[];
|
|
45
|
-
showElementBrowserLink?: boolean;
|
|
46
|
-
showSeparator?: boolean;
|
|
41
|
+
onInsertBlockType?: (name: string) => Command;
|
|
42
|
+
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
47
43
|
onShowMediaPicker?: (mountInfo?: {
|
|
48
|
-
ref: HTMLElement;
|
|
49
44
|
mountPoint: HTMLElement;
|
|
45
|
+
ref: HTMLElement;
|
|
50
46
|
}) => void;
|
|
51
|
-
|
|
52
|
-
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
53
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
47
|
+
placeholderTextEnabled?: boolean;
|
|
54
48
|
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
popupsBoundariesElement?: HTMLElement;
|
|
50
|
+
popupsMountPoint?: HTMLElement;
|
|
51
|
+
popupsScrollableElement?: HTMLElement;
|
|
52
|
+
showElementBrowser: boolean;
|
|
53
|
+
showElementBrowserLink?: boolean;
|
|
54
|
+
showSeparator?: boolean;
|
|
55
|
+
tableSelectorSupported?: boolean;
|
|
56
|
+
tableSupported?: boolean;
|
|
57
57
|
}
|
|
58
58
|
export interface State {
|
|
59
|
-
isPlusMenuOpen: boolean;
|
|
60
|
-
emojiPickerOpen: boolean;
|
|
61
59
|
buttons: BlockMenuItem[];
|
|
62
60
|
dropdownItems: BlockMenuItem[];
|
|
61
|
+
emojiPickerOpen: boolean;
|
|
63
62
|
isOpenedByKeyboard: boolean;
|
|
63
|
+
isPlusMenuOpen: boolean;
|
|
64
64
|
isTableSelectorOpen: boolean;
|
|
65
65
|
isTableSelectorOpenedByKeyboard: boolean;
|
|
66
66
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { InsertBlockPluginOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
|
|
3
3
|
export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
|
|
4
|
-
pluginConfiguration: InsertBlockPluginOptions | undefined;
|
|
5
|
-
dependencies: InsertBlockPluginDependencies;
|
|
6
4
|
actions: {
|
|
7
5
|
toggleAdditionalMenu: () => void;
|
|
8
6
|
};
|
|
7
|
+
dependencies: InsertBlockPluginDependencies;
|
|
8
|
+
pluginConfiguration: InsertBlockPluginOptions | undefined;
|
|
9
9
|
sharedState: InsertBlockPluginState | undefined;
|
|
10
10
|
}>;
|
|
@@ -56,10 +56,11 @@ export type InsertBlockPluginDependencies = [
|
|
|
56
56
|
OptionalPlugin<ToolbarPlugin>
|
|
57
57
|
];
|
|
58
58
|
export interface InsertBlockPluginOptions {
|
|
59
|
-
allowTables?: boolean;
|
|
60
59
|
allowExpand?: boolean;
|
|
61
|
-
|
|
60
|
+
allowTables?: boolean;
|
|
61
|
+
appearance?: EditorAppearance;
|
|
62
62
|
horizontalRuleEnabled?: boolean;
|
|
63
|
+
insertMenuItems?: any;
|
|
63
64
|
nativeStatusSupported?: boolean;
|
|
64
65
|
/**
|
|
65
66
|
* To hide the element browser "view more" button in the
|
|
@@ -68,7 +69,6 @@ export interface InsertBlockPluginOptions {
|
|
|
68
69
|
*/
|
|
69
70
|
showElementBrowserLink?: boolean;
|
|
70
71
|
tableSelectorSupported?: boolean;
|
|
71
|
-
appearance?: EditorAppearance;
|
|
72
72
|
/**
|
|
73
73
|
* To hide the individual insert block buttons in the toolbar
|
|
74
74
|
* and only show the plus button
|
|
@@ -8,11 +8,11 @@ type SimpleEventHandler<T> = (event?: T) => void;
|
|
|
8
8
|
export interface InsertMenuProps {
|
|
9
9
|
dropdownItems: BlockMenuItem[];
|
|
10
10
|
editorView: EditorView;
|
|
11
|
-
|
|
12
|
-
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
13
12
|
onInsert: OnInsert;
|
|
14
13
|
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
15
|
-
|
|
14
|
+
showElementBrowserLink: boolean;
|
|
15
|
+
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
16
16
|
}
|
|
17
17
|
export type SvgGetterParams = {
|
|
18
18
|
name: string;
|
|
@@ -8,22 +8,22 @@ type SimpleEventHandler<T> = (event?: T) => void;
|
|
|
8
8
|
export interface BlockInsertElementBrowserProps {
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
editorView: EditorView;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
11
12
|
items: BlockMenuItem[];
|
|
12
|
-
spacing: 'none' | 'default';
|
|
13
13
|
label: string;
|
|
14
|
+
onClick: React.MouseEventHandler;
|
|
15
|
+
onInsert: OnInsert;
|
|
16
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
17
|
+
onRef(el: HTMLElement): void;
|
|
14
18
|
open: boolean;
|
|
19
|
+
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
20
|
+
plusButtonRef?: HTMLElement;
|
|
15
21
|
popupsBoundariesElement?: HTMLElement;
|
|
16
22
|
popupsMountPoint?: HTMLElement;
|
|
17
23
|
popupsScrollableElement?: HTMLElement;
|
|
18
|
-
plusButtonRef?: HTMLElement;
|
|
19
24
|
showElementBrowserLink: boolean;
|
|
20
|
-
|
|
21
|
-
onClick: React.MouseEventHandler;
|
|
22
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
23
|
-
onInsert: OnInsert;
|
|
25
|
+
spacing: 'none' | 'default';
|
|
24
26
|
togglePlusMenuVisibility: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
25
|
-
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
26
|
-
isFullPageAppearance?: boolean;
|
|
27
27
|
}
|
|
28
28
|
export declare const BlockInsertElementBrowser: (props: BlockInsertElementBrowserProps) => React.JSX.Element;
|
|
29
29
|
export {};
|
|
@@ -8,26 +8,26 @@ import type { BlockMenuItem } from './create-items';
|
|
|
8
8
|
export interface BlockInsertMenuProps {
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
editorView: EditorView;
|
|
11
|
+
isFullPageAppearance?: boolean;
|
|
11
12
|
items: BlockMenuItem[];
|
|
12
13
|
label: string;
|
|
14
|
+
onClick: React.MouseEventHandler;
|
|
15
|
+
onInsert: OnInsert;
|
|
16
|
+
onItemActivated?: (attrs: {
|
|
17
|
+
item: MenuItem;
|
|
18
|
+
}) => void;
|
|
19
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
20
|
+
onOpenChange?: (attrs: any) => void;
|
|
21
|
+
onPlusButtonRef(el: HTMLElement): void;
|
|
22
|
+
onRef(el: HTMLElement): void;
|
|
13
23
|
open: boolean;
|
|
24
|
+
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
14
25
|
plusButtonRef?: HTMLElement;
|
|
15
26
|
popupsBoundariesElement?: HTMLElement;
|
|
16
27
|
popupsMountPoint?: HTMLElement;
|
|
17
28
|
popupsScrollableElement?: HTMLElement;
|
|
18
|
-
spacing: 'none' | 'default';
|
|
19
29
|
showElementBrowserLink: boolean;
|
|
20
|
-
|
|
21
|
-
onPlusButtonRef(el: HTMLElement): void;
|
|
22
|
-
onClick: React.MouseEventHandler;
|
|
23
|
-
onItemActivated?: (attrs: {
|
|
24
|
-
item: MenuItem;
|
|
25
|
-
}) => void;
|
|
26
|
-
onInsert: OnInsert;
|
|
27
|
-
onOpenChange?: (attrs: any) => void;
|
|
30
|
+
spacing: 'none' | 'default';
|
|
28
31
|
togglePlusMenuVisibility(): void;
|
|
29
|
-
onKeyDown?: React.KeyboardEventHandler;
|
|
30
|
-
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
31
|
-
isFullPageAppearance?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const BlockInsertMenu: (props: BlockInsertMenuProps) => React.JSX.Element | null;
|
|
@@ -4,38 +4,38 @@ import type { BlockType } from '@atlaskit/editor-plugin-block-type';
|
|
|
4
4
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
6
6
|
export interface CreateItemsConfig {
|
|
7
|
-
isTypeAheadAllowed?: boolean;
|
|
8
|
-
tableSupported?: boolean;
|
|
9
|
-
tableSelectorSupported?: boolean;
|
|
10
|
-
mediaUploadsEnabled?: boolean;
|
|
11
|
-
mediaSupported?: boolean;
|
|
12
|
-
imageUploadSupported?: boolean;
|
|
13
|
-
imageUploadEnabled?: boolean;
|
|
14
|
-
mentionsSupported?: boolean;
|
|
15
|
-
mentionsDisabled?: boolean;
|
|
16
|
-
availableWrapperBlockTypes?: BlockType[];
|
|
17
7
|
actionSupported?: boolean;
|
|
8
|
+
availableWrapperBlockTypes?: BlockType[];
|
|
9
|
+
dateEnabled?: boolean;
|
|
18
10
|
decisionSupported?: boolean;
|
|
19
|
-
linkSupported?: boolean;
|
|
20
|
-
linkDisabled?: boolean;
|
|
21
11
|
emojiDisabled?: boolean;
|
|
12
|
+
emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
|
|
13
|
+
expandEnabled?: boolean;
|
|
14
|
+
formatMessage: WrappedComponentProps['intl']['formatMessage'];
|
|
22
15
|
hasEmojiPlugin?: boolean;
|
|
23
|
-
hasMentionsPlugin?: boolean;
|
|
24
16
|
hasMediaPlugin?: boolean;
|
|
25
|
-
|
|
26
|
-
dateEnabled?: boolean;
|
|
27
|
-
placeholderTextEnabled?: boolean;
|
|
17
|
+
hasMentionsPlugin?: boolean;
|
|
28
18
|
horizontalRuleEnabled?: boolean;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
expandEnabled?: boolean;
|
|
19
|
+
imageUploadEnabled?: boolean;
|
|
20
|
+
imageUploadSupported?: boolean;
|
|
32
21
|
insertMenuItems?: MenuItem[];
|
|
33
|
-
emojiProvider?: Promise<EmojiProvider> | EmojiProvider;
|
|
34
|
-
schema: Schema;
|
|
35
|
-
numberOfButtons: number;
|
|
36
|
-
formatMessage: WrappedComponentProps['intl']['formatMessage'];
|
|
37
|
-
isNewMenuEnabled?: boolean;
|
|
38
22
|
isEditorOffline?: boolean;
|
|
23
|
+
isNewMenuEnabled?: boolean;
|
|
24
|
+
isTypeAheadAllowed?: boolean;
|
|
25
|
+
layoutSectionEnabled?: boolean;
|
|
26
|
+
linkDisabled?: boolean;
|
|
27
|
+
linkSupported?: boolean;
|
|
28
|
+
mediaSupported?: boolean;
|
|
29
|
+
mediaUploadsEnabled?: boolean;
|
|
30
|
+
mentionsDisabled?: boolean;
|
|
31
|
+
mentionsSupported?: boolean;
|
|
32
|
+
nativeStatusSupported?: boolean;
|
|
33
|
+
numberOfButtons: number;
|
|
34
|
+
placeholderTextEnabled?: boolean;
|
|
35
|
+
schema: Schema;
|
|
36
|
+
showElementBrowserLink?: boolean;
|
|
37
|
+
tableSelectorSupported?: boolean;
|
|
38
|
+
tableSupported?: boolean;
|
|
39
39
|
}
|
|
40
40
|
export interface BlockMenuItem extends MenuItem {
|
|
41
41
|
title: JSX.Element | null;
|
|
@@ -6,15 +6,15 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
export interface DropDownButtonProps {
|
|
9
|
-
label: string;
|
|
10
|
-
selected: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
9
|
'aria-expanded': React.AriaAttributes['aria-expanded'];
|
|
13
10
|
'aria-haspopup': React.AriaAttributes['aria-haspopup'];
|
|
14
11
|
'aria-keyshortcuts'?: React.AriaAttributes['aria-keyshortcuts'];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
handleRef(el: ToolbarButtonRef): void;
|
|
14
|
+
label: string;
|
|
15
15
|
onClick: React.MouseEventHandler;
|
|
16
16
|
onKeyDown?: React.KeyboardEventHandler;
|
|
17
|
+
selected: boolean;
|
|
17
18
|
spacing: 'none' | 'default';
|
|
18
|
-
handleRef(el: ToolbarButtonRef): void;
|
|
19
19
|
}
|
|
20
20
|
export declare const DropDownButton: React.MemoExoticComponent<(props: DropDownButtonProps) => jsx.JSX.Element>;
|
|
@@ -7,8 +7,8 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import type { Props, State } from './types';
|
|
9
9
|
export declare const tableButtonWrapper: ({ isTableSelectorOpen, isButtonDisabled, }: {
|
|
10
|
-
isTableSelectorOpen: boolean;
|
|
11
10
|
isButtonDisabled: boolean | undefined;
|
|
11
|
+
isTableSelectorOpen: boolean;
|
|
12
12
|
}) => import("@emotion/react").SerializedStyles;
|
|
13
13
|
export declare class ToolbarInsertBlock extends React.PureComponent<Props & WrappedComponentProps, State> {
|
|
14
14
|
private dropdownButtonRef?;
|
|
@@ -6,11 +6,11 @@ import React from 'react';
|
|
|
6
6
|
import type { MemoizedFn } from 'memoize-one';
|
|
7
7
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
export interface CreateInit {
|
|
9
|
+
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
10
|
+
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
9
11
|
content: string;
|
|
10
12
|
disabled: boolean;
|
|
11
13
|
tooltipDescription?: string;
|
|
12
|
-
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
13
|
-
'aria-haspopup'?: React.AriaAttributes['aria-haspopup'];
|
|
14
14
|
}
|
|
15
15
|
export declare const action: MemoizedFn<(init: CreateInit) => MenuItem>;
|
|
16
16
|
export declare const link: MemoizedFn<(init: CreateInit) => MenuItem>;
|
|
@@ -9,58 +9,58 @@ import type { EmojiProvider } from '@atlaskit/emoji';
|
|
|
9
9
|
import type { InsertBlockPlugin } from '../../index';
|
|
10
10
|
import type { BlockMenuItem } from './create-items';
|
|
11
11
|
export interface Props {
|
|
12
|
-
buttons: number;
|
|
13
|
-
showElementBrowser: boolean;
|
|
14
|
-
isReducedSpacing: boolean;
|
|
15
|
-
isDisabled?: boolean;
|
|
16
|
-
isTypeAheadAllowed?: boolean;
|
|
17
|
-
editorView: EditorView;
|
|
18
|
-
editorActions?: EditorActions;
|
|
19
|
-
tableSupported?: boolean;
|
|
20
|
-
tableSelectorSupported?: boolean;
|
|
21
12
|
actionSupported?: boolean;
|
|
13
|
+
availableWrapperBlockTypes?: BlockType[];
|
|
14
|
+
buttons: number;
|
|
15
|
+
dateEnabled?: boolean;
|
|
22
16
|
decisionSupported?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
18
|
+
editorActions?: EditorActions;
|
|
19
|
+
editorAppearance?: EditorAppearance;
|
|
20
|
+
editorView: EditorView;
|
|
21
|
+
emojiDisabled?: boolean;
|
|
22
|
+
emojiProvider?: Promise<EmojiProvider>;
|
|
23
|
+
expandEnabled?: boolean;
|
|
29
24
|
handleImageUpload?: (event?: ImageUploadPluginReferenceEvent) => Command;
|
|
30
|
-
dateEnabled?: boolean;
|
|
31
25
|
horizontalRuleEnabled?: boolean;
|
|
32
|
-
|
|
26
|
+
imageUploadEnabled?: boolean;
|
|
27
|
+
imageUploadSupported?: boolean;
|
|
28
|
+
insertMenuItems?: MenuItem[];
|
|
29
|
+
isDisabled?: boolean;
|
|
30
|
+
isEditorOffline?: boolean;
|
|
31
|
+
isReducedSpacing: boolean;
|
|
32
|
+
isTypeAheadAllowed?: boolean;
|
|
33
33
|
layoutSectionEnabled?: boolean;
|
|
34
|
-
expandEnabled?: boolean;
|
|
35
|
-
emojiProvider?: Promise<EmojiProvider>;
|
|
36
|
-
availableWrapperBlockTypes?: BlockType[];
|
|
37
|
-
linkSupported?: boolean;
|
|
38
34
|
linkDisabled?: boolean;
|
|
39
|
-
|
|
35
|
+
linkSupported?: boolean;
|
|
36
|
+
mediaSupported?: boolean;
|
|
37
|
+
mediaUploadsEnabled?: boolean;
|
|
38
|
+
mentionsDisabled?: boolean;
|
|
39
|
+
mentionsSupported?: boolean;
|
|
40
40
|
nativeStatusSupported?: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
popupsScrollableElement?: HTMLElement;
|
|
44
|
-
insertMenuItems?: MenuItem[];
|
|
45
|
-
showElementBrowserLink?: boolean;
|
|
46
|
-
showSeparator?: boolean;
|
|
41
|
+
onInsertBlockType?: (name: string) => Command;
|
|
42
|
+
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
47
43
|
onShowMediaPicker?: (mountInfo?: {
|
|
48
|
-
ref: HTMLElement;
|
|
49
44
|
mountPoint: HTMLElement;
|
|
45
|
+
ref: HTMLElement;
|
|
50
46
|
}) => void;
|
|
51
|
-
|
|
52
|
-
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
53
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
47
|
+
placeholderTextEnabled?: boolean;
|
|
54
48
|
pluginInjectionApi: ExtractInjectionAPI<InsertBlockPlugin> | undefined;
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
popupsBoundariesElement?: HTMLElement;
|
|
50
|
+
popupsMountPoint?: HTMLElement;
|
|
51
|
+
popupsScrollableElement?: HTMLElement;
|
|
52
|
+
showElementBrowser: boolean;
|
|
53
|
+
showElementBrowserLink?: boolean;
|
|
54
|
+
showSeparator?: boolean;
|
|
55
|
+
tableSelectorSupported?: boolean;
|
|
56
|
+
tableSupported?: boolean;
|
|
57
57
|
}
|
|
58
58
|
export interface State {
|
|
59
|
-
isPlusMenuOpen: boolean;
|
|
60
|
-
emojiPickerOpen: boolean;
|
|
61
59
|
buttons: BlockMenuItem[];
|
|
62
60
|
dropdownItems: BlockMenuItem[];
|
|
61
|
+
emojiPickerOpen: boolean;
|
|
63
62
|
isOpenedByKeyboard: boolean;
|
|
63
|
+
isPlusMenuOpen: boolean;
|
|
64
64
|
isTableSelectorOpen: boolean;
|
|
65
65
|
isTableSelectorOpenedByKeyboard: boolean;
|
|
66
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"@atlaskit/editor-plugin-quick-insert": "^3.0.0",
|
|
56
56
|
"@atlaskit/editor-plugin-rule": "^3.0.0",
|
|
57
57
|
"@atlaskit/editor-plugin-status": "^4.1.0",
|
|
58
|
-
"@atlaskit/editor-plugin-table": "^12.
|
|
58
|
+
"@atlaskit/editor-plugin-table": "^12.3.0",
|
|
59
59
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^6.4.0",
|
|
60
|
-
"@atlaskit/editor-plugin-toolbar": "^0.
|
|
60
|
+
"@atlaskit/editor-plugin-toolbar": "^0.4.0",
|
|
61
61
|
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
62
62
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
63
63
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
71
|
"@atlaskit/primitives": "^14.11.0",
|
|
72
72
|
"@atlaskit/theme": "^19.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
74
74
|
"@atlaskit/tokens": "^6.0.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.4.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"@af/integration-testing": "workspace:^",
|
|
91
91
|
"@af/visual-regression": "workspace:^",
|
|
92
92
|
"@atlaskit/ssr": "workspace:^",
|
|
93
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
94
93
|
"@testing-library/react": "^13.4.0",
|
|
95
94
|
"@types/react-virtualized": "^9.18.12"
|
|
96
95
|
},
|