@atlaskit/editor-plugin-selection-extension 3.5.1 → 3.5.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/pm-plugins/main.d.ts +6 -6
- package/dist/types/pm-plugins/utils/getOffsetByPath.d.ts +3 -3
- package/dist/types/pm-plugins/utils/index.d.ts +2 -2
- package/dist/types/selectionExtensionPluginType.d.ts +16 -16
- package/dist/types/types/index.d.ts +28 -28
- package/dist/types/ui/LegacyToolbarComponent.d.ts +2 -2
- package/dist/types/ui/extension/SelectionExtensionComponentWrapper.d.ts +1 -1
- package/dist/types/ui/extensions.d.ts +1 -1
- package/dist/types/ui/selectionToolbar.d.ts +1 -1
- package/dist/types/ui/toolbar/SelectionExtensionDropdownMenu.d.ts +3 -3
- package/dist/types/ui/toolbar/SelectionExtensionItems.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -6
- package/dist/types-ts4.5/pm-plugins/utils/getOffsetByPath.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/selectionExtensionPluginType.d.ts +16 -16
- package/dist/types-ts4.5/types/index.d.ts +28 -28
- package/dist/types-ts4.5/ui/LegacyToolbarComponent.d.ts +2 -2
- package/dist/types-ts4.5/ui/extension/SelectionExtensionComponentWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/extensions.d.ts +1 -1
- package/dist/types-ts4.5/ui/selectionToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/SelectionExtensionDropdownMenu.d.ts +3 -3
- package/dist/types-ts4.5/ui/toolbar/SelectionExtensionItems.d.ts +1 -1
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 3.5.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
|
+
## 3.5.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.5.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -4,28 +4,28 @@ import { type SelectionExtensionPluginState } from '../types';
|
|
|
4
4
|
export declare const selectionExtensionPluginKey: PluginKey<SelectionExtensionPluginState>;
|
|
5
5
|
export declare const createPlugin: () => SafePlugin<SelectionExtensionPluginState | {
|
|
6
6
|
activeExtension: any;
|
|
7
|
-
|
|
7
|
+
docChangedAfterClick?: boolean;
|
|
8
8
|
nodePos?: number;
|
|
9
|
+
selectedNode?: import("prosemirror-model").Node;
|
|
9
10
|
startTrackChanges?: boolean;
|
|
10
|
-
docChangedAfterClick?: boolean;
|
|
11
11
|
} | {
|
|
12
12
|
selectedNode: any;
|
|
13
13
|
nodePos: any;
|
|
14
14
|
startTrackChanges: boolean;
|
|
15
15
|
docChangedAfterClick: boolean;
|
|
16
16
|
activeExtension?: {
|
|
17
|
+
coords: import("../types").SelectionExtensionCoords;
|
|
17
18
|
extension: import("../types").SelectionExtension;
|
|
18
19
|
selection: import("../types").SelectionExtensionSelectionInfo;
|
|
19
|
-
coords: import("../types").SelectionExtensionCoords;
|
|
20
20
|
};
|
|
21
21
|
} | {
|
|
22
22
|
startTrackChanges: any;
|
|
23
23
|
activeExtension?: {
|
|
24
|
+
coords: import("../types").SelectionExtensionCoords;
|
|
24
25
|
extension: import("../types").SelectionExtension;
|
|
25
26
|
selection: import("../types").SelectionExtensionSelectionInfo;
|
|
26
|
-
coords: import("../types").SelectionExtensionCoords;
|
|
27
27
|
};
|
|
28
|
-
selectedNode?: import("prosemirror-model").Node;
|
|
29
|
-
nodePos?: number;
|
|
30
28
|
docChangedAfterClick?: boolean;
|
|
29
|
+
nodePos?: number;
|
|
30
|
+
selectedNode?: import("prosemirror-model").Node;
|
|
31
31
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export interface NodeOffset {
|
|
3
|
-
type: 'node';
|
|
4
3
|
from: number;
|
|
5
|
-
to: number;
|
|
6
4
|
matches: string[];
|
|
5
|
+
to: number;
|
|
6
|
+
type: 'node';
|
|
7
7
|
}
|
|
8
8
|
export interface AttrsOffset {
|
|
9
|
-
type: 'attrs';
|
|
10
9
|
from: number;
|
|
11
10
|
path: string[];
|
|
11
|
+
type: 'attrs';
|
|
12
12
|
}
|
|
13
13
|
export type Offset = NodeOffset | AttrsOffset;
|
|
14
14
|
export declare function getOffsetByPath(root: PMNode, pos: number, pointer: string, from?: number, to?: number): Offset;
|
|
@@ -7,10 +7,10 @@ import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginTyp
|
|
|
7
7
|
import type { SelectionExtensionSelectionInfo } from '../../types';
|
|
8
8
|
import { type SelectionRange } from '../../types';
|
|
9
9
|
type SelectionInfo = {
|
|
10
|
+
nodePos: number;
|
|
11
|
+
selectedNode: PMNode;
|
|
10
12
|
selectedNodeAdf: ADFEntity;
|
|
11
13
|
selectionRanges?: SelectionRange[];
|
|
12
|
-
selectedNode: PMNode;
|
|
13
|
-
nodePos: number;
|
|
14
14
|
};
|
|
15
15
|
export declare const getSelectionTextInfo: (view: EditorView, api?: ExtractInjectionAPI<SelectionExtensionPlugin>) => SelectionExtensionSelectionInfo;
|
|
16
16
|
export declare const getFragmentInfoFromSelection: (state: EditorState) => {
|
|
@@ -7,7 +7,21 @@ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-t
|
|
|
7
7
|
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
8
8
|
import type { DynamicSelectionExtension, SelectionAdfResult, InsertAdfAtEndOfDocResult, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo } from './types';
|
|
9
9
|
export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
|
|
10
|
-
|
|
10
|
+
actions: {
|
|
11
|
+
getDocumentFromSelection: () => {
|
|
12
|
+
selectedNodeAdf?: ADFEntity;
|
|
13
|
+
} | null;
|
|
14
|
+
getSelectionAdf: () => SelectionAdfResult;
|
|
15
|
+
insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => InsertAdfAtEndOfDocResult;
|
|
16
|
+
replaceWithAdf: (nodeAdf: ADFEntity) => ReplaceWithAdfResult;
|
|
17
|
+
};
|
|
18
|
+
commands: {
|
|
19
|
+
clearActiveExtension: () => EditorCommand;
|
|
20
|
+
setActiveExtension: ({ extension, selection, }: {
|
|
21
|
+
extension: SelectionExtension | DynamicSelectionExtension;
|
|
22
|
+
selection: SelectionExtensionSelectionInfo;
|
|
23
|
+
}) => EditorCommand;
|
|
24
|
+
};
|
|
11
25
|
dependencies: [
|
|
12
26
|
OptionalPlugin<AnalyticsPlugin>,
|
|
13
27
|
OptionalPlugin<EditorViewModePlugin>,
|
|
@@ -15,20 +29,6 @@ export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
|
|
|
15
29
|
OptionalPlugin<UserPreferencesPlugin>,
|
|
16
30
|
SelectionToolbarPlugin
|
|
17
31
|
];
|
|
32
|
+
pluginConfiguration: SelectionExtensionPluginOptions | undefined;
|
|
18
33
|
sharedState: SelectionExtensionPluginState | null;
|
|
19
|
-
commands: {
|
|
20
|
-
setActiveExtension: ({ extension, selection, }: {
|
|
21
|
-
extension: SelectionExtension | DynamicSelectionExtension;
|
|
22
|
-
selection: SelectionExtensionSelectionInfo;
|
|
23
|
-
}) => EditorCommand;
|
|
24
|
-
clearActiveExtension: () => EditorCommand;
|
|
25
|
-
};
|
|
26
|
-
actions: {
|
|
27
|
-
replaceWithAdf: (nodeAdf: ADFEntity) => ReplaceWithAdfResult;
|
|
28
|
-
insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => InsertAdfAtEndOfDocResult;
|
|
29
|
-
getSelectionAdf: () => SelectionAdfResult;
|
|
30
|
-
getDocumentFromSelection: () => {
|
|
31
|
-
selectedNodeAdf?: ADFEntity;
|
|
32
|
-
} | null;
|
|
33
|
-
};
|
|
34
34
|
}>;
|
|
@@ -10,30 +10,30 @@ export type SelectionExtensionComponentProps = {
|
|
|
10
10
|
selection: SelectionExtensionSelectionInfo;
|
|
11
11
|
};
|
|
12
12
|
export type SelectionExtensionCallbackOptions = {
|
|
13
|
-
selection?: SelectionExtensionSelectionInfo;
|
|
14
13
|
selectedNodeAdf?: ADFEntity;
|
|
14
|
+
selection?: SelectionExtensionSelectionInfo;
|
|
15
15
|
selectionRanges?: SelectionRange[];
|
|
16
16
|
};
|
|
17
17
|
export type SelectionExtensionSelectionInfo = {
|
|
18
|
-
|
|
18
|
+
coords: SelectionExtensionCoords;
|
|
19
19
|
from: number;
|
|
20
|
+
text: string;
|
|
20
21
|
to: number;
|
|
21
|
-
coords: SelectionExtensionCoords;
|
|
22
22
|
};
|
|
23
23
|
export type SelectionCoords = {
|
|
24
|
+
bottom: number;
|
|
24
25
|
left: number;
|
|
25
26
|
right: number;
|
|
26
27
|
top: number;
|
|
27
|
-
bottom: number;
|
|
28
28
|
};
|
|
29
29
|
export type SelectionExtension = {
|
|
30
|
-
|
|
30
|
+
component?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
31
31
|
icon?: React.ComponentType<React.PropsWithChildren<{
|
|
32
32
|
label: string;
|
|
33
33
|
}>>;
|
|
34
34
|
isDisabled?: (params: SelectionExtensionCallbackOptions) => boolean;
|
|
35
|
+
name: string;
|
|
35
36
|
onClick?: (params: SelectionExtensionCallbackOptions) => void;
|
|
36
|
-
component?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
37
37
|
};
|
|
38
38
|
export type DynamicSelectionExtension = Omit<SelectionExtension, 'isDisabled'> & {
|
|
39
39
|
isDisabled?: boolean;
|
|
@@ -43,8 +43,8 @@ export type SelectionPointer = {
|
|
|
43
43
|
position?: number;
|
|
44
44
|
};
|
|
45
45
|
export type SelectionRange = {
|
|
46
|
-
start: SelectionPointer;
|
|
47
46
|
end: SelectionPointer;
|
|
47
|
+
start: SelectionPointer;
|
|
48
48
|
};
|
|
49
49
|
export type SelectionExtensionFnOptions = {
|
|
50
50
|
selectedNodeAdf: ADFEntity;
|
|
@@ -53,14 +53,14 @@ export type SelectionExtensionFnOptions = {
|
|
|
53
53
|
export type SelectionExtensionFn = ({ selectedNodeAdf, selectionRanges, }: SelectionExtensionFnOptions) => DynamicSelectionExtension;
|
|
54
54
|
export type SelectionExtensionConfig = SelectionExtension | SelectionExtensionFn;
|
|
55
55
|
export type SelectionExtensions = {
|
|
56
|
-
firstParty?: SelectionExtensionConfig[];
|
|
57
56
|
external?: SelectionExtensionConfig[];
|
|
57
|
+
firstParty?: SelectionExtensionConfig[];
|
|
58
58
|
};
|
|
59
59
|
type SelectionExtensionModes = ViewMode;
|
|
60
60
|
export type SelectionExtensionPluginOptions = {
|
|
61
|
-
pageModes?: SelectionExtensionModes | SelectionExtensionModes[];
|
|
62
|
-
extensions?: SelectionExtensions;
|
|
63
61
|
extensionList?: ExtensionConfiguration[];
|
|
62
|
+
extensions?: SelectionExtensions;
|
|
63
|
+
pageModes?: SelectionExtensionModes | SelectionExtensionModes[];
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* @private
|
|
@@ -69,23 +69,23 @@ export type SelectionExtensionPluginOptions = {
|
|
|
69
69
|
*/
|
|
70
70
|
export type SelectionExtensionPluginConfiguration = SelectionExtensionPluginOptions;
|
|
71
71
|
export type SelectionExtensionCoords = {
|
|
72
|
+
bottom: number;
|
|
72
73
|
left: number;
|
|
73
74
|
right: number;
|
|
74
75
|
top: number;
|
|
75
|
-
bottom: number;
|
|
76
76
|
};
|
|
77
77
|
export type BoundingBoxOffset = {
|
|
78
|
-
top: number;
|
|
79
78
|
bottom: number;
|
|
79
|
+
top: number;
|
|
80
80
|
};
|
|
81
81
|
export type InsertPosition = {
|
|
82
|
-
pointer: string;
|
|
83
82
|
from?: number;
|
|
83
|
+
pointer: string;
|
|
84
84
|
to?: number;
|
|
85
85
|
};
|
|
86
86
|
export type LinkInsertionOption = {
|
|
87
|
-
link: string;
|
|
88
87
|
insertPosition: InsertPosition;
|
|
88
|
+
link: string;
|
|
89
89
|
};
|
|
90
90
|
export declare enum SelectionExtensionActionTypes {
|
|
91
91
|
SET_ACTIVE_EXTENSION = "set-active-extension",
|
|
@@ -95,24 +95,24 @@ export declare enum SelectionExtensionActionTypes {
|
|
|
95
95
|
START_TRACK_CHANGES = "start-track-changes"
|
|
96
96
|
}
|
|
97
97
|
export type UpdateActiveExtensionAction = {
|
|
98
|
-
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
99
98
|
extension: SelectionExtension;
|
|
99
|
+
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
100
100
|
} | {
|
|
101
|
-
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
102
101
|
coords: SelectionExtensionCoords;
|
|
102
|
+
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
103
103
|
} | {
|
|
104
104
|
type: SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION;
|
|
105
105
|
};
|
|
106
106
|
export type SelectionExtensionPluginState = {
|
|
107
107
|
activeExtension?: {
|
|
108
|
+
coords: SelectionExtensionCoords;
|
|
108
109
|
extension: SelectionExtension;
|
|
109
110
|
selection: SelectionExtensionSelectionInfo;
|
|
110
|
-
coords: SelectionExtensionCoords;
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
docChangedAfterClick?: boolean;
|
|
113
113
|
nodePos?: number;
|
|
114
|
+
selectedNode?: PMNode;
|
|
114
115
|
startTrackChanges?: boolean;
|
|
115
|
-
docChangedAfterClick?: boolean;
|
|
116
116
|
};
|
|
117
117
|
export type ReplaceWithAdfStatus = 'success' | 'document-changed' | 'failed-to-replace';
|
|
118
118
|
export type ReplaceWithAdfResult = {
|
|
@@ -127,18 +127,18 @@ export type SelectionAdfResult = {
|
|
|
127
127
|
} | null;
|
|
128
128
|
export type ExtensionSource = 'first-party' | 'external';
|
|
129
129
|
export type ExtensionConfiguration = {
|
|
130
|
-
|
|
131
|
-
source: ExtensionSource;
|
|
130
|
+
blockMenu?: BlockMenuExtensionConfiguration;
|
|
132
131
|
inlineToolbar?: ToolbarExtensionConfiguration;
|
|
132
|
+
key: string;
|
|
133
133
|
primaryToolbar?: ToolbarExtensionConfiguration;
|
|
134
|
-
|
|
134
|
+
source: ExtensionSource;
|
|
135
135
|
};
|
|
136
136
|
export type GetToolbarItemFn = () => ExtensionToolbarItemConfiguration;
|
|
137
137
|
export type GetMenuItemsFn = () => Array<ExtensionMenuItemConfiguration | ExtensionMenuSectionConfiguration>;
|
|
138
138
|
export type GetMenuItemFn = () => Omit<ExtensionMenuItemConfiguration, 'section'>;
|
|
139
139
|
export type ToolbarExtensionConfiguration = {
|
|
140
|
-
getToolbarItem?: GetToolbarItemFn;
|
|
141
140
|
getMenuItems?: GetMenuItemsFn;
|
|
141
|
+
getToolbarItem?: GetToolbarItemFn;
|
|
142
142
|
};
|
|
143
143
|
export type BlockMenuExtensionConfiguration = {
|
|
144
144
|
getMenuItem: GetMenuItemFn;
|
|
@@ -148,19 +148,19 @@ export type ExtensionToolbarItemConfiguration = {
|
|
|
148
148
|
icon: React.ComponentType<React.PropsWithChildren<{
|
|
149
149
|
label: string;
|
|
150
150
|
}>>;
|
|
151
|
-
tooltip: string;
|
|
152
151
|
isDisabled?: boolean;
|
|
153
|
-
onClick?: () => void;
|
|
154
152
|
label?: string;
|
|
153
|
+
onClick?: () => void;
|
|
154
|
+
tooltip: string;
|
|
155
155
|
};
|
|
156
156
|
export type ExtensionMenuItemConfiguration = {
|
|
157
|
-
|
|
157
|
+
contentComponent?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
158
158
|
icon: React.ComponentType<React.PropsWithChildren<{
|
|
159
159
|
label: string;
|
|
160
160
|
}>>;
|
|
161
|
-
onClick?: () => void;
|
|
162
161
|
isDisabled?: boolean;
|
|
163
|
-
|
|
162
|
+
label: string;
|
|
163
|
+
onClick?: () => void;
|
|
164
164
|
/**
|
|
165
165
|
* Optional menu-section to declare grouping - only used for menu items
|
|
166
166
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtensionToolbarItemConfiguration, GetMenuItemsFn, GetToolbarItemFn } from '../types';
|
|
3
3
|
export type ToolbarItemExtension = {
|
|
4
|
-
getToolbarItem: GetToolbarItemFn;
|
|
5
4
|
getMenuItems?: GetMenuItemsFn;
|
|
5
|
+
getToolbarItem: GetToolbarItemFn;
|
|
6
6
|
};
|
|
7
7
|
type LegacyPrimaryToolbarComponentProps = {
|
|
8
8
|
primaryToolbarItemExtensions: ToolbarItemExtension[];
|
|
9
9
|
};
|
|
10
10
|
export declare const LegacyPrimaryToolbarComponent: ({ primaryToolbarItemExtensions, }: LegacyPrimaryToolbarComponentProps) => React.JSX.Element;
|
|
11
11
|
type LegacyExtensionToolbarItemProps = {
|
|
12
|
-
toolbarItem: ExtensionToolbarItemConfiguration;
|
|
13
12
|
getMenuItems?: GetMenuItemsFn;
|
|
13
|
+
toolbarItem: ExtensionToolbarItemConfiguration;
|
|
14
14
|
};
|
|
15
15
|
export declare const LegacyExtensionToolbarItem: ({ toolbarItem, getMenuItems, }: LegacyExtensionToolbarItemProps) => React.JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -5,8 +5,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
6
6
|
type SelectionExtensionComponentWrapperProps = {
|
|
7
7
|
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined | null;
|
|
8
|
-
editorView: EditorView;
|
|
9
8
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
9
|
+
editorView: EditorView;
|
|
10
10
|
};
|
|
11
11
|
export declare const SelectionExtensionComponentWrapper: ({ api, editorAnalyticsAPI, }: SelectionExtensionComponentWrapperProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtensionConfiguration, ExtensionSource, GetMenuItemsFn, GetToolbarItemFn, SelectionExtensionConfig } from '../types';
|
|
2
2
|
export type ToolbarItemExtension = {
|
|
3
|
-
getToolbarItem: GetToolbarItemFn;
|
|
4
3
|
getMenuItems?: GetMenuItemsFn;
|
|
4
|
+
getToolbarItem: GetToolbarItemFn;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* From the full list of extensions, extract only those that have a toolbar item configuration
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Command, FloatingToolbarOverflowDropdownOptions, SelectionToolbarGroup } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { ExtensionConfiguration } from '../types';
|
|
3
3
|
type SelectionToolbarOptions = {
|
|
4
|
-
overflowOptions: FloatingToolbarOverflowDropdownOptions<Command>;
|
|
5
4
|
extensionList?: ExtensionConfiguration[];
|
|
5
|
+
overflowOptions: FloatingToolbarOverflowDropdownOptions<Command>;
|
|
6
6
|
};
|
|
7
7
|
export declare const selectionToolbar: ({ overflowOptions, extensionList, }: SelectionToolbarOptions) => SelectionToolbarGroup;
|
|
8
8
|
export {};
|
|
@@ -4,27 +4,27 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { type MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
5
|
import { type MenuItemsType } from '../../types';
|
|
6
6
|
export type SelectionExtensionDropdownMenuProps = {
|
|
7
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
7
8
|
items: MenuItemsType;
|
|
8
9
|
onItemActivated?: (attrs: {
|
|
9
10
|
item: MenuItem;
|
|
10
11
|
shouldCloseMenu?: boolean;
|
|
11
12
|
}) => void;
|
|
12
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
13
13
|
} & WrappedComponentProps;
|
|
14
14
|
export declare const SelectionExtensionDropdownMenu: React.FC<import("react-intl-next").WithIntlProps<{
|
|
15
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
15
16
|
items: MenuItemsType;
|
|
16
17
|
onItemActivated?: (attrs: {
|
|
17
18
|
item: MenuItem;
|
|
18
19
|
shouldCloseMenu?: boolean;
|
|
19
20
|
}) => void;
|
|
20
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
23
24
|
items: MenuItemsType;
|
|
24
25
|
onItemActivated?: (attrs: {
|
|
25
26
|
item: MenuItem;
|
|
26
27
|
shouldCloseMenu?: boolean;
|
|
27
28
|
}) => void;
|
|
28
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
29
29
|
} & WrappedComponentProps>;
|
|
30
30
|
};
|
|
@@ -10,9 +10,9 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
10
10
|
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
11
11
|
import type { SelectionExtension } from '../../types';
|
|
12
12
|
type SelectionExtensionItemsProps = {
|
|
13
|
-
editorView: EditorView;
|
|
14
13
|
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
15
14
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
15
|
+
editorView: EditorView;
|
|
16
16
|
extensions: SelectionExtension[];
|
|
17
17
|
onExtensionClick: (extension: SelectionExtension) => void;
|
|
18
18
|
} & WrappedComponentProps;
|
|
@@ -4,28 +4,28 @@ import { type SelectionExtensionPluginState } from '../types';
|
|
|
4
4
|
export declare const selectionExtensionPluginKey: PluginKey<SelectionExtensionPluginState>;
|
|
5
5
|
export declare const createPlugin: () => SafePlugin<SelectionExtensionPluginState | {
|
|
6
6
|
activeExtension: any;
|
|
7
|
-
|
|
7
|
+
docChangedAfterClick?: boolean;
|
|
8
8
|
nodePos?: number;
|
|
9
|
+
selectedNode?: import("prosemirror-model").Node;
|
|
9
10
|
startTrackChanges?: boolean;
|
|
10
|
-
docChangedAfterClick?: boolean;
|
|
11
11
|
} | {
|
|
12
12
|
selectedNode: any;
|
|
13
13
|
nodePos: any;
|
|
14
14
|
startTrackChanges: boolean;
|
|
15
15
|
docChangedAfterClick: boolean;
|
|
16
16
|
activeExtension?: {
|
|
17
|
+
coords: import("../types").SelectionExtensionCoords;
|
|
17
18
|
extension: import("../types").SelectionExtension;
|
|
18
19
|
selection: import("../types").SelectionExtensionSelectionInfo;
|
|
19
|
-
coords: import("../types").SelectionExtensionCoords;
|
|
20
20
|
};
|
|
21
21
|
} | {
|
|
22
22
|
startTrackChanges: any;
|
|
23
23
|
activeExtension?: {
|
|
24
|
+
coords: import("../types").SelectionExtensionCoords;
|
|
24
25
|
extension: import("../types").SelectionExtension;
|
|
25
26
|
selection: import("../types").SelectionExtensionSelectionInfo;
|
|
26
|
-
coords: import("../types").SelectionExtensionCoords;
|
|
27
27
|
};
|
|
28
|
-
selectedNode?: import("prosemirror-model").Node;
|
|
29
|
-
nodePos?: number;
|
|
30
28
|
docChangedAfterClick?: boolean;
|
|
29
|
+
nodePos?: number;
|
|
30
|
+
selectedNode?: import("prosemirror-model").Node;
|
|
31
31
|
}>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export interface NodeOffset {
|
|
3
|
-
type: 'node';
|
|
4
3
|
from: number;
|
|
5
|
-
to: number;
|
|
6
4
|
matches: string[];
|
|
5
|
+
to: number;
|
|
6
|
+
type: 'node';
|
|
7
7
|
}
|
|
8
8
|
export interface AttrsOffset {
|
|
9
|
-
type: 'attrs';
|
|
10
9
|
from: number;
|
|
11
10
|
path: string[];
|
|
11
|
+
type: 'attrs';
|
|
12
12
|
}
|
|
13
13
|
export type Offset = NodeOffset | AttrsOffset;
|
|
14
14
|
export declare function getOffsetByPath(root: PMNode, pos: number, pointer: string, from?: number, to?: number): Offset;
|
|
@@ -7,10 +7,10 @@ import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginTyp
|
|
|
7
7
|
import type { SelectionExtensionSelectionInfo } from '../../types';
|
|
8
8
|
import { type SelectionRange } from '../../types';
|
|
9
9
|
type SelectionInfo = {
|
|
10
|
+
nodePos: number;
|
|
11
|
+
selectedNode: PMNode;
|
|
10
12
|
selectedNodeAdf: ADFEntity;
|
|
11
13
|
selectionRanges?: SelectionRange[];
|
|
12
|
-
selectedNode: PMNode;
|
|
13
|
-
nodePos: number;
|
|
14
14
|
};
|
|
15
15
|
export declare const getSelectionTextInfo: (view: EditorView, api?: ExtractInjectionAPI<SelectionExtensionPlugin>) => SelectionExtensionSelectionInfo;
|
|
16
16
|
export declare const getFragmentInfoFromSelection: (state: EditorState) => {
|
|
@@ -7,7 +7,21 @@ import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-t
|
|
|
7
7
|
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
8
8
|
import type { DynamicSelectionExtension, SelectionAdfResult, InsertAdfAtEndOfDocResult, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo } from './types';
|
|
9
9
|
export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
|
|
10
|
-
|
|
10
|
+
actions: {
|
|
11
|
+
getDocumentFromSelection: () => {
|
|
12
|
+
selectedNodeAdf?: ADFEntity;
|
|
13
|
+
} | null;
|
|
14
|
+
getSelectionAdf: () => SelectionAdfResult;
|
|
15
|
+
insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => InsertAdfAtEndOfDocResult;
|
|
16
|
+
replaceWithAdf: (nodeAdf: ADFEntity) => ReplaceWithAdfResult;
|
|
17
|
+
};
|
|
18
|
+
commands: {
|
|
19
|
+
clearActiveExtension: () => EditorCommand;
|
|
20
|
+
setActiveExtension: ({ extension, selection, }: {
|
|
21
|
+
extension: SelectionExtension | DynamicSelectionExtension;
|
|
22
|
+
selection: SelectionExtensionSelectionInfo;
|
|
23
|
+
}) => EditorCommand;
|
|
24
|
+
};
|
|
11
25
|
dependencies: [
|
|
12
26
|
OptionalPlugin<AnalyticsPlugin>,
|
|
13
27
|
OptionalPlugin<EditorViewModePlugin>,
|
|
@@ -15,20 +29,6 @@ export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
|
|
|
15
29
|
OptionalPlugin<UserPreferencesPlugin>,
|
|
16
30
|
SelectionToolbarPlugin
|
|
17
31
|
];
|
|
32
|
+
pluginConfiguration: SelectionExtensionPluginOptions | undefined;
|
|
18
33
|
sharedState: SelectionExtensionPluginState | null;
|
|
19
|
-
commands: {
|
|
20
|
-
setActiveExtension: ({ extension, selection, }: {
|
|
21
|
-
extension: SelectionExtension | DynamicSelectionExtension;
|
|
22
|
-
selection: SelectionExtensionSelectionInfo;
|
|
23
|
-
}) => EditorCommand;
|
|
24
|
-
clearActiveExtension: () => EditorCommand;
|
|
25
|
-
};
|
|
26
|
-
actions: {
|
|
27
|
-
replaceWithAdf: (nodeAdf: ADFEntity) => ReplaceWithAdfResult;
|
|
28
|
-
insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => InsertAdfAtEndOfDocResult;
|
|
29
|
-
getSelectionAdf: () => SelectionAdfResult;
|
|
30
|
-
getDocumentFromSelection: () => {
|
|
31
|
-
selectedNodeAdf?: ADFEntity;
|
|
32
|
-
} | null;
|
|
33
|
-
};
|
|
34
34
|
}>;
|
|
@@ -10,30 +10,30 @@ export type SelectionExtensionComponentProps = {
|
|
|
10
10
|
selection: SelectionExtensionSelectionInfo;
|
|
11
11
|
};
|
|
12
12
|
export type SelectionExtensionCallbackOptions = {
|
|
13
|
-
selection?: SelectionExtensionSelectionInfo;
|
|
14
13
|
selectedNodeAdf?: ADFEntity;
|
|
14
|
+
selection?: SelectionExtensionSelectionInfo;
|
|
15
15
|
selectionRanges?: SelectionRange[];
|
|
16
16
|
};
|
|
17
17
|
export type SelectionExtensionSelectionInfo = {
|
|
18
|
-
|
|
18
|
+
coords: SelectionExtensionCoords;
|
|
19
19
|
from: number;
|
|
20
|
+
text: string;
|
|
20
21
|
to: number;
|
|
21
|
-
coords: SelectionExtensionCoords;
|
|
22
22
|
};
|
|
23
23
|
export type SelectionCoords = {
|
|
24
|
+
bottom: number;
|
|
24
25
|
left: number;
|
|
25
26
|
right: number;
|
|
26
27
|
top: number;
|
|
27
|
-
bottom: number;
|
|
28
28
|
};
|
|
29
29
|
export type SelectionExtension = {
|
|
30
|
-
|
|
30
|
+
component?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
31
31
|
icon?: React.ComponentType<React.PropsWithChildren<{
|
|
32
32
|
label: string;
|
|
33
33
|
}>>;
|
|
34
34
|
isDisabled?: (params: SelectionExtensionCallbackOptions) => boolean;
|
|
35
|
+
name: string;
|
|
35
36
|
onClick?: (params: SelectionExtensionCallbackOptions) => void;
|
|
36
|
-
component?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
37
37
|
};
|
|
38
38
|
export type DynamicSelectionExtension = Omit<SelectionExtension, 'isDisabled'> & {
|
|
39
39
|
isDisabled?: boolean;
|
|
@@ -43,8 +43,8 @@ export type SelectionPointer = {
|
|
|
43
43
|
position?: number;
|
|
44
44
|
};
|
|
45
45
|
export type SelectionRange = {
|
|
46
|
-
start: SelectionPointer;
|
|
47
46
|
end: SelectionPointer;
|
|
47
|
+
start: SelectionPointer;
|
|
48
48
|
};
|
|
49
49
|
export type SelectionExtensionFnOptions = {
|
|
50
50
|
selectedNodeAdf: ADFEntity;
|
|
@@ -53,14 +53,14 @@ export type SelectionExtensionFnOptions = {
|
|
|
53
53
|
export type SelectionExtensionFn = ({ selectedNodeAdf, selectionRanges, }: SelectionExtensionFnOptions) => DynamicSelectionExtension;
|
|
54
54
|
export type SelectionExtensionConfig = SelectionExtension | SelectionExtensionFn;
|
|
55
55
|
export type SelectionExtensions = {
|
|
56
|
-
firstParty?: SelectionExtensionConfig[];
|
|
57
56
|
external?: SelectionExtensionConfig[];
|
|
57
|
+
firstParty?: SelectionExtensionConfig[];
|
|
58
58
|
};
|
|
59
59
|
type SelectionExtensionModes = ViewMode;
|
|
60
60
|
export type SelectionExtensionPluginOptions = {
|
|
61
|
-
pageModes?: SelectionExtensionModes | SelectionExtensionModes[];
|
|
62
|
-
extensions?: SelectionExtensions;
|
|
63
61
|
extensionList?: ExtensionConfiguration[];
|
|
62
|
+
extensions?: SelectionExtensions;
|
|
63
|
+
pageModes?: SelectionExtensionModes | SelectionExtensionModes[];
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* @private
|
|
@@ -69,23 +69,23 @@ export type SelectionExtensionPluginOptions = {
|
|
|
69
69
|
*/
|
|
70
70
|
export type SelectionExtensionPluginConfiguration = SelectionExtensionPluginOptions;
|
|
71
71
|
export type SelectionExtensionCoords = {
|
|
72
|
+
bottom: number;
|
|
72
73
|
left: number;
|
|
73
74
|
right: number;
|
|
74
75
|
top: number;
|
|
75
|
-
bottom: number;
|
|
76
76
|
};
|
|
77
77
|
export type BoundingBoxOffset = {
|
|
78
|
-
top: number;
|
|
79
78
|
bottom: number;
|
|
79
|
+
top: number;
|
|
80
80
|
};
|
|
81
81
|
export type InsertPosition = {
|
|
82
|
-
pointer: string;
|
|
83
82
|
from?: number;
|
|
83
|
+
pointer: string;
|
|
84
84
|
to?: number;
|
|
85
85
|
};
|
|
86
86
|
export type LinkInsertionOption = {
|
|
87
|
-
link: string;
|
|
88
87
|
insertPosition: InsertPosition;
|
|
88
|
+
link: string;
|
|
89
89
|
};
|
|
90
90
|
export declare enum SelectionExtensionActionTypes {
|
|
91
91
|
SET_ACTIVE_EXTENSION = "set-active-extension",
|
|
@@ -95,24 +95,24 @@ export declare enum SelectionExtensionActionTypes {
|
|
|
95
95
|
START_TRACK_CHANGES = "start-track-changes"
|
|
96
96
|
}
|
|
97
97
|
export type UpdateActiveExtensionAction = {
|
|
98
|
-
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
99
98
|
extension: SelectionExtension;
|
|
99
|
+
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
100
100
|
} | {
|
|
101
|
-
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
102
101
|
coords: SelectionExtensionCoords;
|
|
102
|
+
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
103
103
|
} | {
|
|
104
104
|
type: SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION;
|
|
105
105
|
};
|
|
106
106
|
export type SelectionExtensionPluginState = {
|
|
107
107
|
activeExtension?: {
|
|
108
|
+
coords: SelectionExtensionCoords;
|
|
108
109
|
extension: SelectionExtension;
|
|
109
110
|
selection: SelectionExtensionSelectionInfo;
|
|
110
|
-
coords: SelectionExtensionCoords;
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
docChangedAfterClick?: boolean;
|
|
113
113
|
nodePos?: number;
|
|
114
|
+
selectedNode?: PMNode;
|
|
114
115
|
startTrackChanges?: boolean;
|
|
115
|
-
docChangedAfterClick?: boolean;
|
|
116
116
|
};
|
|
117
117
|
export type ReplaceWithAdfStatus = 'success' | 'document-changed' | 'failed-to-replace';
|
|
118
118
|
export type ReplaceWithAdfResult = {
|
|
@@ -127,18 +127,18 @@ export type SelectionAdfResult = {
|
|
|
127
127
|
} | null;
|
|
128
128
|
export type ExtensionSource = 'first-party' | 'external';
|
|
129
129
|
export type ExtensionConfiguration = {
|
|
130
|
-
|
|
131
|
-
source: ExtensionSource;
|
|
130
|
+
blockMenu?: BlockMenuExtensionConfiguration;
|
|
132
131
|
inlineToolbar?: ToolbarExtensionConfiguration;
|
|
132
|
+
key: string;
|
|
133
133
|
primaryToolbar?: ToolbarExtensionConfiguration;
|
|
134
|
-
|
|
134
|
+
source: ExtensionSource;
|
|
135
135
|
};
|
|
136
136
|
export type GetToolbarItemFn = () => ExtensionToolbarItemConfiguration;
|
|
137
137
|
export type GetMenuItemsFn = () => Array<ExtensionMenuItemConfiguration | ExtensionMenuSectionConfiguration>;
|
|
138
138
|
export type GetMenuItemFn = () => Omit<ExtensionMenuItemConfiguration, 'section'>;
|
|
139
139
|
export type ToolbarExtensionConfiguration = {
|
|
140
|
-
getToolbarItem?: GetToolbarItemFn;
|
|
141
140
|
getMenuItems?: GetMenuItemsFn;
|
|
141
|
+
getToolbarItem?: GetToolbarItemFn;
|
|
142
142
|
};
|
|
143
143
|
export type BlockMenuExtensionConfiguration = {
|
|
144
144
|
getMenuItem: GetMenuItemFn;
|
|
@@ -148,19 +148,19 @@ export type ExtensionToolbarItemConfiguration = {
|
|
|
148
148
|
icon: React.ComponentType<React.PropsWithChildren<{
|
|
149
149
|
label: string;
|
|
150
150
|
}>>;
|
|
151
|
-
tooltip: string;
|
|
152
151
|
isDisabled?: boolean;
|
|
153
|
-
onClick?: () => void;
|
|
154
152
|
label?: string;
|
|
153
|
+
onClick?: () => void;
|
|
154
|
+
tooltip: string;
|
|
155
155
|
};
|
|
156
156
|
export type ExtensionMenuItemConfiguration = {
|
|
157
|
-
|
|
157
|
+
contentComponent?: React.ComponentType<SelectionExtensionComponentProps>;
|
|
158
158
|
icon: React.ComponentType<React.PropsWithChildren<{
|
|
159
159
|
label: string;
|
|
160
160
|
}>>;
|
|
161
|
-
onClick?: () => void;
|
|
162
161
|
isDisabled?: boolean;
|
|
163
|
-
|
|
162
|
+
label: string;
|
|
163
|
+
onClick?: () => void;
|
|
164
164
|
/**
|
|
165
165
|
* Optional menu-section to declare grouping - only used for menu items
|
|
166
166
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtensionToolbarItemConfiguration, GetMenuItemsFn, GetToolbarItemFn } from '../types';
|
|
3
3
|
export type ToolbarItemExtension = {
|
|
4
|
-
getToolbarItem: GetToolbarItemFn;
|
|
5
4
|
getMenuItems?: GetMenuItemsFn;
|
|
5
|
+
getToolbarItem: GetToolbarItemFn;
|
|
6
6
|
};
|
|
7
7
|
type LegacyPrimaryToolbarComponentProps = {
|
|
8
8
|
primaryToolbarItemExtensions: ToolbarItemExtension[];
|
|
9
9
|
};
|
|
10
10
|
export declare const LegacyPrimaryToolbarComponent: ({ primaryToolbarItemExtensions, }: LegacyPrimaryToolbarComponentProps) => React.JSX.Element;
|
|
11
11
|
type LegacyExtensionToolbarItemProps = {
|
|
12
|
-
toolbarItem: ExtensionToolbarItemConfiguration;
|
|
13
12
|
getMenuItems?: GetMenuItemsFn;
|
|
13
|
+
toolbarItem: ExtensionToolbarItemConfiguration;
|
|
14
14
|
};
|
|
15
15
|
export declare const LegacyExtensionToolbarItem: ({ toolbarItem, getMenuItems, }: LegacyExtensionToolbarItemProps) => React.JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -5,8 +5,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
6
6
|
type SelectionExtensionComponentWrapperProps = {
|
|
7
7
|
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined | null;
|
|
8
|
-
editorView: EditorView;
|
|
9
8
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
9
|
+
editorView: EditorView;
|
|
10
10
|
};
|
|
11
11
|
export declare const SelectionExtensionComponentWrapper: ({ api, editorAnalyticsAPI, }: SelectionExtensionComponentWrapperProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtensionConfiguration, ExtensionSource, GetMenuItemsFn, GetToolbarItemFn, SelectionExtensionConfig } from '../types';
|
|
2
2
|
export type ToolbarItemExtension = {
|
|
3
|
-
getToolbarItem: GetToolbarItemFn;
|
|
4
3
|
getMenuItems?: GetMenuItemsFn;
|
|
4
|
+
getToolbarItem: GetToolbarItemFn;
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* From the full list of extensions, extract only those that have a toolbar item configuration
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Command, FloatingToolbarOverflowDropdownOptions, SelectionToolbarGroup } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { ExtensionConfiguration } from '../types';
|
|
3
3
|
type SelectionToolbarOptions = {
|
|
4
|
-
overflowOptions: FloatingToolbarOverflowDropdownOptions<Command>;
|
|
5
4
|
extensionList?: ExtensionConfiguration[];
|
|
5
|
+
overflowOptions: FloatingToolbarOverflowDropdownOptions<Command>;
|
|
6
6
|
};
|
|
7
7
|
export declare const selectionToolbar: ({ overflowOptions, extensionList, }: SelectionToolbarOptions) => SelectionToolbarGroup;
|
|
8
8
|
export {};
|
|
@@ -4,27 +4,27 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { type MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
5
|
import { type MenuItemsType } from '../../types';
|
|
6
6
|
export type SelectionExtensionDropdownMenuProps = {
|
|
7
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
7
8
|
items: MenuItemsType;
|
|
8
9
|
onItemActivated?: (attrs: {
|
|
9
10
|
item: MenuItem;
|
|
10
11
|
shouldCloseMenu?: boolean;
|
|
11
12
|
}) => void;
|
|
12
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
13
13
|
} & WrappedComponentProps;
|
|
14
14
|
export declare const SelectionExtensionDropdownMenu: React.FC<import("react-intl-next").WithIntlProps<{
|
|
15
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
15
16
|
items: MenuItemsType;
|
|
16
17
|
onItemActivated?: (attrs: {
|
|
17
18
|
item: MenuItem;
|
|
18
19
|
shouldCloseMenu?: boolean;
|
|
19
20
|
}) => void;
|
|
20
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
23
24
|
items: MenuItemsType;
|
|
24
25
|
onItemActivated?: (attrs: {
|
|
25
26
|
item: MenuItem;
|
|
26
27
|
shouldCloseMenu?: boolean;
|
|
27
28
|
}) => void;
|
|
28
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
29
29
|
} & WrappedComponentProps>;
|
|
30
30
|
};
|
|
@@ -10,9 +10,9 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
10
10
|
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
11
11
|
import type { SelectionExtension } from '../../types';
|
|
12
12
|
type SelectionExtensionItemsProps = {
|
|
13
|
-
editorView: EditorView;
|
|
14
13
|
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
15
14
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
15
|
+
editorView: EditorView;
|
|
16
16
|
extensions: SelectionExtension[];
|
|
17
17
|
onExtensionClick: (extension: SelectionExtension) => void;
|
|
18
18
|
} & WrappedComponentProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/adf-utils": "^19.21.0",
|
|
39
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
39
|
+
"@atlaskit/editor-json-transformer": "^8.27.0",
|
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
|
|
@@ -45,24 +45,23 @@
|
|
|
45
45
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
46
46
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
47
47
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
48
|
-
"@atlaskit/icon": "^
|
|
48
|
+
"@atlaskit/icon": "^28.0.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/primitives": "^14.11.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
55
55
|
"uuid": "^3.1.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^107.
|
|
58
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
59
59
|
"react": "^18.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@af/integration-testing": "workspace:^",
|
|
63
63
|
"@af/visual-regression": "workspace:^",
|
|
64
64
|
"@atlaskit/ssr": "workspace:^",
|
|
65
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
66
65
|
"@testing-library/react": "^13.4.0",
|
|
67
66
|
"react-dom": "^18.2.0",
|
|
68
67
|
"wait-for-expect": "^1.2.0"
|