@atlaskit/editor-plugin-selection-extension 14.1.11 → 14.1.13
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 +12 -0
- package/package.json +2 -2
- package/selection-extension-plugin/package.json +1 -8
- package/selection-extension-plugin-type/package.json +1 -8
- package/types/package.json +1 -8
- package/dist/types-ts4.5/entry-points/selection-extension-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/selection-extension-plugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/actions/insertAdfAtEndOfDoc.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/actions/replaceWithAdf.d.ts +0 -6
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -32
- package/dist/types-ts4.5/pm-plugins/utils/getOffsetByPath.d.ts +0 -14
- package/dist/types-ts4.5/pm-plugins/utils/index.d.ts +0 -37
- package/dist/types-ts4.5/pm-plugins/utils/selection-helpers.d.ts +0 -46
- package/dist/types-ts4.5/selectionExtensionPlugin.d.ts +0 -2
- package/dist/types-ts4.5/selectionExtensionPluginType.d.ts +0 -46
- package/dist/types-ts4.5/types/index.d.ts +0 -226
- package/dist/types-ts4.5/ui/LegacyToolbarComponent.d.ts +0 -16
- package/dist/types-ts4.5/ui/SelectionExtensionComponentContext.d.ts +0 -14
- package/dist/types-ts4.5/ui/extension/SelectionExtensionComponentWrapper.d.ts +0 -12
- package/dist/types-ts4.5/ui/extensions.d.ts +0 -27
- package/dist/types-ts4.5/ui/getBoundingBoxFromSelection.d.ts +0 -12
- package/dist/types-ts4.5/ui/menu/SelectionExtensionDropdownItem.d.ts +0 -11
- package/dist/types-ts4.5/ui/menu/SelectionExtensionMenuItems.d.ts +0 -7
- package/dist/types-ts4.5/ui/menu/SelectionExtensionNestedDropdownMenu.d.ts +0 -6
- package/dist/types-ts4.5/ui/selectionToolbar.d.ts +0 -8
- package/dist/types-ts4.5/ui/toolbar/SelectionExtensionDropdownMenu.d.ts +0 -30
- package/dist/types-ts4.5/ui/toolbar/SelectionExtensionDropdownMenuButton.d.ts +0 -8
- package/dist/types-ts4.5/ui/toolbar/SelectionExtensionItems.d.ts +0 -23
- package/dist/types-ts4.5/ui/toolbar-components/MenuItem.d.ts +0 -10
- package/dist/types-ts4.5/ui/toolbar-components/ToolbarButton.d.ts +0 -10
- package/dist/types-ts4.5/ui/toolbar-components/ToolbarMenu.d.ts +0 -10
- package/dist/types-ts4.5/ui/toolbar-components/register-inline-toolbar.d.ts +0 -11
- package/dist/types-ts4.5/ui/toolbar-components.d.ts +0 -11
- package/dist/types-ts4.5/ui/utils/menu-items.d.ts +0 -8
- package/dist/types-ts4.5/ui/utils/migrate-selection-extention.d.ts +0 -14
- package/dist/types-ts4.5/ui/utils/registerBlockMenuItems.d.ts +0 -16
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.13",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/lozenge": "^13.9.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^19.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
56
56
|
"@atlaskit/tokens": "^13.4.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/selection-extension-plugin.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/selection-extension-plugin.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/selection-extension-plugin.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/selection-extension-plugin-type.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/selection-extension-plugin-type.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/selection-extension-plugin-type.d.ts"
|
|
17
10
|
}
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { SelectionExtensionPlugin } from '../selectionExtensionPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { selectionExtensionPlugin } from '../selectionExtensionPlugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { BlockMenuExtensionConfiguration, ExtensionConfiguration, ExtensionMenuItemConfiguration, ExtensionToolbarItemConfiguration, InsertAdfAtEndOfDocResult, LinkInsertionOption, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, ToolbarExtensionConfiguration, SelectionAdfResult, SelectionExtensionCallbackOptions, SelectionRange, } from '../types/index';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { selectionExtensionPlugin } from './selectionExtensionPlugin';
|
|
2
|
-
export type { SelectionExtensionPlugin } from './selectionExtensionPluginType';
|
|
3
|
-
export type { BlockMenuExtensionConfiguration, ExtensionConfiguration, ExtensionMenuItemConfiguration, ExtensionToolbarItemConfiguration, InsertAdfAtEndOfDocResult, LinkInsertionOption, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, ToolbarExtensionConfiguration, SelectionAdfResult, SelectionExtensionCallbackOptions, SelectionRange, } from './types';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { CommandDispatch } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { InsertAdfAtEndOfDocResult } from '../../types';
|
|
5
|
-
export declare const insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => (state: EditorState, dispatch: CommandDispatch) => InsertAdfAtEndOfDocResult;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { CommandDispatch, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
5
|
-
import { type ReplaceWithAdfResult } from '../../types';
|
|
6
|
-
export declare const replaceWithAdf: (nodeAdf: ADFEntity, api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined) => (state: EditorState, dispatch: CommandDispatch) => ReplaceWithAdfResult;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { type ExtensionMenuItemConfiguration, type SelectionExtension, type SelectionExtensionCoords, type SelectionExtensionPluginState, type SelectionExtensionSelectionInfo } from '../types';
|
|
5
|
-
export declare const selectionExtensionPluginKey: PluginKey<SelectionExtensionPluginState>;
|
|
6
|
-
export declare const createPlugin: () => SafePlugin<SelectionExtensionPluginState | {
|
|
7
|
-
activeExtension: any;
|
|
8
|
-
docChangedAfterClick?: boolean;
|
|
9
|
-
nodePos?: number;
|
|
10
|
-
selectedNode?: Node;
|
|
11
|
-
startTrackChanges?: boolean;
|
|
12
|
-
} | {
|
|
13
|
-
activeExtension?: {
|
|
14
|
-
coords: SelectionExtensionCoords;
|
|
15
|
-
extension: SelectionExtension | ExtensionMenuItemConfiguration;
|
|
16
|
-
selection: SelectionExtensionSelectionInfo;
|
|
17
|
-
};
|
|
18
|
-
docChangedAfterClick: boolean;
|
|
19
|
-
nodePos: any;
|
|
20
|
-
selectedNode: any;
|
|
21
|
-
startTrackChanges: boolean;
|
|
22
|
-
} | {
|
|
23
|
-
activeExtension?: {
|
|
24
|
-
coords: SelectionExtensionCoords;
|
|
25
|
-
extension: SelectionExtension | ExtensionMenuItemConfiguration;
|
|
26
|
-
selection: SelectionExtensionSelectionInfo;
|
|
27
|
-
};
|
|
28
|
-
docChangedAfterClick?: boolean;
|
|
29
|
-
nodePos?: number;
|
|
30
|
-
selectedNode?: Node;
|
|
31
|
-
startTrackChanges: any;
|
|
32
|
-
}>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export interface NodeOffset {
|
|
3
|
-
from: number;
|
|
4
|
-
matches: string[];
|
|
5
|
-
to: number;
|
|
6
|
-
type: 'node';
|
|
7
|
-
}
|
|
8
|
-
export interface AttrsOffset {
|
|
9
|
-
from: number;
|
|
10
|
-
path: string[];
|
|
11
|
-
type: 'attrs';
|
|
12
|
-
}
|
|
13
|
-
export type Offset = NodeOffset | AttrsOffset;
|
|
14
|
-
export declare function getOffsetByPath(root: PMNode, pos: number, pointer: string, from?: number, to?: number): Offset;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { type EditorState, type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
7
|
-
import type { SelectionExtensionSelectionInfo } from '../../types';
|
|
8
|
-
import type { SelectionRange } from '../../types';
|
|
9
|
-
type SelectionInfo = {
|
|
10
|
-
nodePos: number;
|
|
11
|
-
selectedNode: PMNode;
|
|
12
|
-
selectedNodeAdf: ADFEntity;
|
|
13
|
-
selectionRanges?: SelectionRange[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
* @deprecated use getSelectionTextInfoNew instead
|
|
18
|
-
*/
|
|
19
|
-
export declare const getSelectionTextInfo: (view: EditorView, api?: ExtractInjectionAPI<SelectionExtensionPlugin>) => SelectionExtensionSelectionInfo;
|
|
20
|
-
export declare const getSelectionTextInfoNew: (selection: Selection, view: EditorView, api?: ExtractInjectionAPI<SelectionExtensionPlugin>) => SelectionExtensionSelectionInfo;
|
|
21
|
-
/**
|
|
22
|
-
* @private
|
|
23
|
-
* @deprecated use getFragmentInfoFromSelectionNew instead
|
|
24
|
-
*/
|
|
25
|
-
export declare const getFragmentInfoFromSelection: (state: EditorState) => {
|
|
26
|
-
selectedNodeAdf: ADFEntity;
|
|
27
|
-
};
|
|
28
|
-
export declare const getFragmentInfoFromSelectionNew: (selection: Selection) => {
|
|
29
|
-
selectedNodeAdf: ADFEntity;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @private
|
|
33
|
-
* @deprecated use getSelectionAdfInfoNew instead
|
|
34
|
-
*/
|
|
35
|
-
export declare function getSelectionAdfInfo(state: EditorState): SelectionInfo;
|
|
36
|
-
export declare function getSelectionAdfInfoNew(selection: Selection): SelectionInfo;
|
|
37
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type Node as PMNode, type ResolvedPos, type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { SelectionRange } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
* Build selection ranges for multi-node selections.
|
|
6
|
-
* This function traverses the selectedNode and creates JSON pointer-based ranges
|
|
7
|
-
* that describe what parts of the selectedNode are included in the selection.
|
|
8
|
-
*/
|
|
9
|
-
export declare const buildSelectionRanges: (selectedNode: PMNode, selectedNodePos: number, $from: ResolvedPos, $to: ResolvedPos) => SelectionRange[] | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Find the closest parent container node that contains the selection.
|
|
12
|
-
* - For lists: returns the topmost list (to handle nested lists)
|
|
13
|
-
* - For other containers returns the closest one
|
|
14
|
-
* Returns the parent and its position.
|
|
15
|
-
*/
|
|
16
|
-
export declare const getCommonParentContainer: ($from: ResolvedPos, $to: ResolvedPos) => {
|
|
17
|
-
node: PMNode | null;
|
|
18
|
-
pos: number;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Wraps nodes in a doc fragment if there are multiple nodes
|
|
22
|
-
*/
|
|
23
|
-
export declare const wrapNodesInDoc: (schema: Schema, nodes: PMNode[]) => PMNode;
|
|
24
|
-
export declare const getSelectionInfoFromSameNode: (selection: TextSelection) => {
|
|
25
|
-
selectedNode: PMNode;
|
|
26
|
-
selectionRanges: {
|
|
27
|
-
start: {
|
|
28
|
-
pointer: string;
|
|
29
|
-
position: number;
|
|
30
|
-
};
|
|
31
|
-
end: {
|
|
32
|
-
pointer: string;
|
|
33
|
-
position: number;
|
|
34
|
-
};
|
|
35
|
-
}[];
|
|
36
|
-
nodePos: number;
|
|
37
|
-
};
|
|
38
|
-
export declare const getSelectionInfo: (selection: TextSelection, schema: Schema) => {
|
|
39
|
-
selectedNode: PMNode;
|
|
40
|
-
nodePos: number;
|
|
41
|
-
selectionRanges: SelectionRange[] | undefined;
|
|
42
|
-
} | {
|
|
43
|
-
selectedNode: PMNode;
|
|
44
|
-
nodePos: number;
|
|
45
|
-
selectionRanges?: undefined;
|
|
46
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
|
-
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
5
|
-
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
6
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
7
|
-
import type { EditorViewModeEffectsPlugin } from '@atlaskit/editor-plugin-editor-viewmode-effects';
|
|
8
|
-
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
9
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
|
-
import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
|
|
11
|
-
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
12
|
-
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
13
|
-
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
14
|
-
import type { ExtensionMenuItemConfiguration, InsertAdfAtEndOfDocResult, ReplaceWithAdfResult, SelectionAdfResult, SelectionExtension, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo } from './types';
|
|
15
|
-
export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
|
|
16
|
-
actions: {
|
|
17
|
-
getDocumentFromSelection: () => {
|
|
18
|
-
selectedNodeAdf?: ADFEntity;
|
|
19
|
-
} | null;
|
|
20
|
-
getSelectionAdf: () => SelectionAdfResult;
|
|
21
|
-
insertAdfAtEndOfDoc: (nodeAdf: ADFEntity) => InsertAdfAtEndOfDocResult;
|
|
22
|
-
replaceWithAdf: (nodeAdf: ADFEntity) => ReplaceWithAdfResult;
|
|
23
|
-
};
|
|
24
|
-
commands: {
|
|
25
|
-
clearActiveExtension: () => EditorCommand;
|
|
26
|
-
setActiveExtension: ({ extension, selection, }: {
|
|
27
|
-
extension: SelectionExtension | ExtensionMenuItemConfiguration;
|
|
28
|
-
selection: SelectionExtensionSelectionInfo;
|
|
29
|
-
}) => EditorCommand;
|
|
30
|
-
};
|
|
31
|
-
dependencies: [
|
|
32
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
33
|
-
OptionalPlugin<EditorViewModePlugin>,
|
|
34
|
-
OptionalPlugin<EditorViewModeEffectsPlugin>,
|
|
35
|
-
OptionalPlugin<PrimaryToolbarPlugin>,
|
|
36
|
-
OptionalPlugin<UserPreferencesPlugin>,
|
|
37
|
-
OptionalPlugin<UserIntentPlugin>,
|
|
38
|
-
OptionalPlugin<SelectionPlugin>,
|
|
39
|
-
OptionalPlugin<BlockControlsPlugin>,
|
|
40
|
-
OptionalPlugin<BlockMenuPlugin>,
|
|
41
|
-
OptionalPlugin<ToolbarPlugin>,
|
|
42
|
-
SelectionToolbarPlugin
|
|
43
|
-
];
|
|
44
|
-
pluginConfiguration: SelectionExtensionPluginOptions | undefined;
|
|
45
|
-
sharedState: SelectionExtensionPluginState | null;
|
|
46
|
-
}>;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
-
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
|
-
import type { BLOCK_ACTIONS_FEATURED_EXTENSION_SECTION_KEYS, BlockMenuPlacement } from '@atlaskit/editor-common/block-menu';
|
|
4
|
-
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
|
-
import type { ViewMode } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
6
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
export type MenuItemsType = Array<{
|
|
8
|
-
items: MenuItem[];
|
|
9
|
-
}>;
|
|
10
|
-
export type SelectionExtensionComponentProps = {
|
|
11
|
-
closeExtension: () => void;
|
|
12
|
-
selection: SelectionExtensionSelectionInfo;
|
|
13
|
-
};
|
|
14
|
-
export type SelectionExtensionCallbackOptions = {
|
|
15
|
-
selectedNodeAdf?: ADFEntity;
|
|
16
|
-
selection?: SelectionExtensionSelectionInfo;
|
|
17
|
-
selectionRanges?: SelectionRange[];
|
|
18
|
-
};
|
|
19
|
-
export type SelectionExtensionSelectionInfo = {
|
|
20
|
-
coords: SelectionExtensionCoords;
|
|
21
|
-
from: number;
|
|
22
|
-
text: string;
|
|
23
|
-
to: number;
|
|
24
|
-
};
|
|
25
|
-
export type SelectionCoords = {
|
|
26
|
-
bottom: number;
|
|
27
|
-
left: number;
|
|
28
|
-
right: number;
|
|
29
|
-
top: number;
|
|
30
|
-
};
|
|
31
|
-
export type SelectionExtension = {
|
|
32
|
-
component?: ComponentType<SelectionExtensionComponentProps>;
|
|
33
|
-
icon?: ComponentType<PropsWithChildren<{
|
|
34
|
-
label: string;
|
|
35
|
-
}>>;
|
|
36
|
-
isDisabled?: (params: SelectionExtensionCallbackOptions) => boolean;
|
|
37
|
-
name: string;
|
|
38
|
-
onClick?: (params: SelectionExtensionCallbackOptions) => void;
|
|
39
|
-
};
|
|
40
|
-
export type SelectionPointer = {
|
|
41
|
-
pointer: string;
|
|
42
|
-
position?: number;
|
|
43
|
-
};
|
|
44
|
-
export type SelectionRange = {
|
|
45
|
-
end: SelectionPointer;
|
|
46
|
-
start: SelectionPointer;
|
|
47
|
-
};
|
|
48
|
-
export type SelectionExtensions = {
|
|
49
|
-
external?: SelectionExtension[];
|
|
50
|
-
firstParty?: SelectionExtension[];
|
|
51
|
-
};
|
|
52
|
-
type SelectionExtensionModes = ViewMode;
|
|
53
|
-
export type SelectionExtensionPluginOptions = {
|
|
54
|
-
extensionList?: ExtensionConfiguration[];
|
|
55
|
-
extensions?: SelectionExtensions;
|
|
56
|
-
pageModes?: SelectionExtensionModes | SelectionExtensionModes[];
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* @private
|
|
60
|
-
* @deprecated Use {@link SelectionExtensionPluginOptions} instead.
|
|
61
|
-
* @see https://product-fabric.atlassian.net/browse/ED-27496
|
|
62
|
-
*/
|
|
63
|
-
export type SelectionExtensionPluginConfiguration = SelectionExtensionPluginOptions;
|
|
64
|
-
export type SelectionExtensionCoords = {
|
|
65
|
-
bottom: number;
|
|
66
|
-
left: number;
|
|
67
|
-
right: number;
|
|
68
|
-
top: number;
|
|
69
|
-
};
|
|
70
|
-
export type BoundingBoxOffset = {
|
|
71
|
-
bottom: number;
|
|
72
|
-
top: number;
|
|
73
|
-
};
|
|
74
|
-
export type InsertPosition = {
|
|
75
|
-
from?: number;
|
|
76
|
-
pointer: string;
|
|
77
|
-
to?: number;
|
|
78
|
-
};
|
|
79
|
-
export type LinkInsertionOption = {
|
|
80
|
-
insertPosition: InsertPosition;
|
|
81
|
-
link: string;
|
|
82
|
-
};
|
|
83
|
-
export declare enum SelectionExtensionActionTypes {
|
|
84
|
-
SET_ACTIVE_EXTENSION = "set-active-extension",
|
|
85
|
-
UPDATE_ACTIVE_EXTENSION_COORDS = "update-active-extension-coords",
|
|
86
|
-
CLEAR_ACTIVE_EXTENSION = "clear-active-extension",
|
|
87
|
-
SET_SELECTED_NODE = "set-selected-node",
|
|
88
|
-
START_TRACK_CHANGES = "start-track-changes"
|
|
89
|
-
}
|
|
90
|
-
export type UpdateActiveExtensionAction = {
|
|
91
|
-
extension: SelectionExtension;
|
|
92
|
-
type: SelectionExtensionActionTypes.SET_ACTIVE_EXTENSION;
|
|
93
|
-
} | {
|
|
94
|
-
coords: SelectionExtensionCoords;
|
|
95
|
-
type: SelectionExtensionActionTypes.UPDATE_ACTIVE_EXTENSION_COORDS;
|
|
96
|
-
} | {
|
|
97
|
-
type: SelectionExtensionActionTypes.CLEAR_ACTIVE_EXTENSION;
|
|
98
|
-
};
|
|
99
|
-
export type SelectionExtensionPluginState = {
|
|
100
|
-
activeExtension?: {
|
|
101
|
-
coords: SelectionExtensionCoords;
|
|
102
|
-
extension: SelectionExtension | ExtensionMenuItemConfiguration;
|
|
103
|
-
selection: SelectionExtensionSelectionInfo;
|
|
104
|
-
};
|
|
105
|
-
docChangedAfterClick?: boolean;
|
|
106
|
-
nodePos?: number;
|
|
107
|
-
selectedNode?: PMNode;
|
|
108
|
-
startTrackChanges?: boolean;
|
|
109
|
-
};
|
|
110
|
-
export type ReplaceWithAdfStatus = 'success' | 'document-changed' | 'failed-to-replace';
|
|
111
|
-
export type ReplaceWithAdfResult = {
|
|
112
|
-
status: ReplaceWithAdfStatus;
|
|
113
|
-
};
|
|
114
|
-
export type InsertAdfAtEndOfDocResult = {
|
|
115
|
-
status: 'success' | 'failed';
|
|
116
|
-
};
|
|
117
|
-
export type SelectionAdfResult = {
|
|
118
|
-
selectedNodeAdf?: ADFEntity;
|
|
119
|
-
selectionRanges?: SelectionRange[];
|
|
120
|
-
} | null;
|
|
121
|
-
export type ExtensionSource = 'first-party' | 'external';
|
|
122
|
-
export type ExtensionConfiguration = {
|
|
123
|
-
blockMenu?: BlockMenuExtensionConfiguration;
|
|
124
|
-
inlineToolbar?: ToolbarExtensionConfiguration;
|
|
125
|
-
key: string;
|
|
126
|
-
primaryToolbar?: ToolbarExtensionConfiguration;
|
|
127
|
-
source: ExtensionSource;
|
|
128
|
-
};
|
|
129
|
-
export type GetToolbarItemFn = () => ExtensionToolbarItemConfiguration;
|
|
130
|
-
export type GetMenuItemsFn = () => Array<ExtensionMenuItemConfiguration>;
|
|
131
|
-
export type GetNestedMenuItemsFn = () => Array<ExtensionMenuItemNestedConfiguration>;
|
|
132
|
-
export type ToolbarExtensionConfiguration = {
|
|
133
|
-
getMenuItems?: GetMenuItemsFn;
|
|
134
|
-
getToolbarItem?: GetToolbarItemFn;
|
|
135
|
-
};
|
|
136
|
-
type BlockMenuFeaturedSectionKey = (typeof BLOCK_ACTIONS_FEATURED_EXTENSION_SECTION_KEYS)[number];
|
|
137
|
-
type BlockMenuExtensionConfigurationBase = {
|
|
138
|
-
getMenuItems: GetMenuItemsFn;
|
|
139
|
-
};
|
|
140
|
-
export type BlockMenuExtensionConfiguration = (BlockMenuExtensionConfigurationBase & {
|
|
141
|
-
/**
|
|
142
|
-
* Items are registered as their own top-level section with a separator above.
|
|
143
|
-
*/
|
|
144
|
-
placement: 'featured-section';
|
|
145
|
-
/**
|
|
146
|
-
* Must be included in BLOCK_ACTIONS_FEATURED_EXTENSION_SECTION_KEYS and ranked in MAIN_BLOCK_MENU_SECTION_RANK.
|
|
147
|
-
*/
|
|
148
|
-
sectionKey: BlockMenuFeaturedSectionKey;
|
|
149
|
-
}) | (BlockMenuExtensionConfigurationBase & {
|
|
150
|
-
/**
|
|
151
|
-
* Optional placement hint to control where the menu items appear in the block menu
|
|
152
|
-
* - 'default' (or undefined): Items appear in their normal nested location under create section
|
|
153
|
-
* - 'featured': Items are promoted to top-level alongside the "Turn into" menu
|
|
154
|
-
*/
|
|
155
|
-
placement?: Exclude<BlockMenuPlacement, 'featured-section'>;
|
|
156
|
-
sectionKey?: never;
|
|
157
|
-
});
|
|
158
|
-
export type ExtensionToolbarItemConfiguration = {
|
|
159
|
-
icon: ComponentType<PropsWithChildren<{
|
|
160
|
-
label: string;
|
|
161
|
-
}>>;
|
|
162
|
-
isDisabled?: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Optional key to identify the toolbar item in analytics events
|
|
165
|
-
*/
|
|
166
|
-
key?: string;
|
|
167
|
-
label?: string;
|
|
168
|
-
onClick?: () => void;
|
|
169
|
-
tooltip: string;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Common fields applicable to all extension menu items
|
|
173
|
-
*/
|
|
174
|
-
type ExtensionMenuItemBaseConfiguration = {
|
|
175
|
-
icon?: ComponentType<PropsWithChildren<{
|
|
176
|
-
label: string;
|
|
177
|
-
size?: 'small' | 'medium';
|
|
178
|
-
}>>;
|
|
179
|
-
isDisabled?: boolean;
|
|
180
|
-
/**
|
|
181
|
-
* Optional key to identify the menu item in analytics events
|
|
182
|
-
*/
|
|
183
|
-
key?: string;
|
|
184
|
-
label: string;
|
|
185
|
-
/**
|
|
186
|
-
* Optional lozenge to display next to the label in the menu
|
|
187
|
-
*/
|
|
188
|
-
lozenge?: {
|
|
189
|
-
label: string;
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* Fields for a dropdown item (i.e., an item that does not have further nested menu items)
|
|
194
|
-
*/
|
|
195
|
-
type ExtensionDropdownItemFields = {
|
|
196
|
-
/**
|
|
197
|
-
* Optional content component to render when this menu item is selected
|
|
198
|
-
*
|
|
199
|
-
* Used for forge app extensions that need to render custom UI when selected from the block menu.
|
|
200
|
-
*/
|
|
201
|
-
contentComponent?: ComponentType<SelectionExtensionComponentProps>;
|
|
202
|
-
onClick?: () => void;
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Fields for a nested dropdown menu (i.e., an menu item that has further nested menu items)
|
|
206
|
-
*/
|
|
207
|
-
type ExtensionNestedDropdownMenuFields = {
|
|
208
|
-
getMenuItems: GetNestedMenuItemsFn;
|
|
209
|
-
};
|
|
210
|
-
export type ExtensionDropdownItemConfiguration = ExtensionMenuItemBaseConfiguration & AllNever<ExtensionNestedDropdownMenuFields> & ExtensionDropdownItemFields;
|
|
211
|
-
export type ExtensionNestedDropdownMenuConfiguration = ExtensionMenuItemBaseConfiguration & AllNever<ExtensionDropdownItemFields> & ExtensionNestedDropdownMenuFields;
|
|
212
|
-
type AllNever<T> = {
|
|
213
|
-
[K in keyof T]?: never;
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* This type represents either a dropdown item or a dropdown menu, but not both.
|
|
217
|
-
*
|
|
218
|
-
* We mark all fields of the other type as `never` to enforce this exclusivity.
|
|
219
|
-
*/
|
|
220
|
-
export type ExtensionMenuItemConfiguration = ExtensionDropdownItemConfiguration | ExtensionNestedDropdownMenuConfiguration;
|
|
221
|
-
/**
|
|
222
|
-
* We intentionally only support dropdown items nested within dropdown menus, i.e. no menus nested
|
|
223
|
-
* within menus – so there will be at max two levels of nesting from extension menu items
|
|
224
|
-
*/
|
|
225
|
-
type ExtensionMenuItemNestedConfiguration = ExtensionDropdownItemConfiguration;
|
|
226
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtensionToolbarItemConfiguration, GetMenuItemsFn, GetToolbarItemFn } from '../types';
|
|
3
|
-
export type ToolbarItemExtension = {
|
|
4
|
-
getMenuItems?: GetMenuItemsFn;
|
|
5
|
-
getToolbarItem: GetToolbarItemFn;
|
|
6
|
-
};
|
|
7
|
-
type LegacyPrimaryToolbarComponentProps = {
|
|
8
|
-
primaryToolbarItemExtensions: ToolbarItemExtension[];
|
|
9
|
-
};
|
|
10
|
-
export declare const LegacyPrimaryToolbarComponent: ({ primaryToolbarItemExtensions, }: LegacyPrimaryToolbarComponentProps) => React.JSX.Element;
|
|
11
|
-
type LegacyExtensionToolbarItemProps = {
|
|
12
|
-
getMenuItems?: GetMenuItemsFn;
|
|
13
|
-
toolbarItem: ExtensionToolbarItemConfiguration;
|
|
14
|
-
};
|
|
15
|
-
export declare const LegacyExtensionToolbarItem: ({ toolbarItem, getMenuItems, }: LegacyExtensionToolbarItemProps) => React.JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Provider } from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { SelectionExtensionPlugin } from '../selectionExtensionPluginType';
|
|
5
|
-
type SelectionExtensionComponentContextValue = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin>;
|
|
7
|
-
editorView: EditorView;
|
|
8
|
-
extensionKey: string;
|
|
9
|
-
extensionSource: string;
|
|
10
|
-
extensionLocation: 'inline-toolbar' | 'primary-toolbar' | 'block-menu';
|
|
11
|
-
};
|
|
12
|
-
export declare const SelectionExtensionComponentContextProvider: Provider<SelectionExtensionComponentContextValue | undefined>;
|
|
13
|
-
export declare const useSelectionExtensionComponentContext: () => SelectionExtensionComponentContextValue;
|
|
14
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
6
|
-
type SelectionExtensionComponentWrapperProps = {
|
|
7
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined | null;
|
|
8
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
9
|
-
editorView: EditorView;
|
|
10
|
-
};
|
|
11
|
-
export declare const SelectionExtensionComponentWrapper: ({ api, editorAnalyticsAPI, }: SelectionExtensionComponentWrapperProps) => React.JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ExtensionConfiguration, ExtensionSource, GetMenuItemsFn, GetToolbarItemFn, SelectionExtension } from '../types';
|
|
2
|
-
export type ToolbarItemExtension = {
|
|
3
|
-
getMenuItems?: GetMenuItemsFn;
|
|
4
|
-
getToolbarItem: GetToolbarItemFn;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* From the full list of extensions, extract only those that have a toolbar item configuration
|
|
8
|
-
* for the specified type (either 'primaryToolbar' or 'inlineToolbar').
|
|
9
|
-
*
|
|
10
|
-
* @param extensionList - List of all extensions
|
|
11
|
-
* @param toolbarType - Type of toolbar ('primaryToolbar' or 'inlineToolbar')
|
|
12
|
-
* @returns Array of ToolbarItemExtension objects
|
|
13
|
-
* @example
|
|
14
|
-
*/
|
|
15
|
-
export declare const getToolbarItemExtensions: (extensionList: ExtensionConfiguration[], toolbarType: "primaryToolbar" | "inlineToolbar") => ToolbarItemExtension[];
|
|
16
|
-
/**
|
|
17
|
-
* From the full list of extensions, extract only those that have a menu item configuration
|
|
18
|
-
* for the specified source (either 'first-party' or 'external').
|
|
19
|
-
*
|
|
20
|
-
* Map each to the legacy format for SelectionExtension.
|
|
21
|
-
*
|
|
22
|
-
* @param extensionList - List of all extensions
|
|
23
|
-
* @param targetSource - Source of the extensions ('first-party' or 'external')
|
|
24
|
-
* @returns Array of SelectionExtension objects
|
|
25
|
-
* @example
|
|
26
|
-
*/
|
|
27
|
-
export declare const getMenuItemExtensions: (extensionList: ExtensionConfiguration[], targetSource: ExtensionSource) => SelectionExtension[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { SelectionExtensionCoords, BoundingBoxOffset } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* Calculates the bounding box coordinates of a text selection within an editor view.
|
|
5
|
-
*
|
|
6
|
-
* @param view - The editor view instance.
|
|
7
|
-
* @param from - The starting position of the selection.
|
|
8
|
-
* @param to - The ending position of the selection.
|
|
9
|
-
* @param offset - Optional offset to adjust the top and bottom coordinates of the bounding box.
|
|
10
|
-
* @returns An object containing the top, left, bottom, and right coordinates of the bounding box.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getBoundingBoxFromSelection: (view: EditorView, from: number, to: number, offset?: BoundingBoxOffset) => SelectionExtensionCoords;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { ExtensionDropdownItemConfiguration } from '../../types';
|
|
7
|
-
type SelectionExtensionDropdownItemProps = {
|
|
8
|
-
dropdownItem: ExtensionDropdownItemConfiguration;
|
|
9
|
-
};
|
|
10
|
-
export declare const SelectionExtensionDropdownItem: ({ dropdownItem, }: SelectionExtensionDropdownItemProps) => React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtensionMenuItemConfiguration } from '../../types';
|
|
3
|
-
type SelectionExtensionMenuItemsProps = {
|
|
4
|
-
getMenuItems: () => ExtensionMenuItemConfiguration[];
|
|
5
|
-
};
|
|
6
|
-
export declare const SelectionExtensionMenuItems: ({ getMenuItems, }: SelectionExtensionMenuItemsProps) => React.JSX.Element | null;
|
|
7
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtensionNestedDropdownMenuConfiguration } from '../../types';
|
|
3
|
-
export type SelectionExtensionNestedDropdownMenuProps = {
|
|
4
|
-
nestedDropdownMenu: ExtensionNestedDropdownMenuConfiguration;
|
|
5
|
-
};
|
|
6
|
-
export declare const SelectionExtensionNestedDropdownMenu: ({ nestedDropdownMenu, }: SelectionExtensionNestedDropdownMenuProps) => React.JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Command, FloatingToolbarOverflowDropdownOptions, SelectionToolbarGroup } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ExtensionConfiguration } from '../types';
|
|
3
|
-
type SelectionToolbarOptions = {
|
|
4
|
-
extensionList?: ExtensionConfiguration[];
|
|
5
|
-
overflowOptions: FloatingToolbarOverflowDropdownOptions<Command>;
|
|
6
|
-
};
|
|
7
|
-
export declare const selectionToolbar: ({ overflowOptions, extensionList, }: SelectionToolbarOptions) => SelectionToolbarGroup;
|
|
8
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { type MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
|
-
import type { MenuItemsType } from '../../types';
|
|
6
|
-
export type SelectionExtensionDropdownMenuProps = {
|
|
7
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
8
|
-
items: MenuItemsType;
|
|
9
|
-
onItemActivated?: (attrs: {
|
|
10
|
-
item: MenuItem;
|
|
11
|
-
shouldCloseMenu?: boolean;
|
|
12
|
-
}) => void;
|
|
13
|
-
} & WrappedComponentProps;
|
|
14
|
-
export declare const SelectionExtensionDropdownMenu: React.FC<WithIntlProps<{
|
|
15
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
16
|
-
items: MenuItemsType;
|
|
17
|
-
onItemActivated?: (attrs: {
|
|
18
|
-
item: MenuItem;
|
|
19
|
-
shouldCloseMenu?: boolean;
|
|
20
|
-
}) => void;
|
|
21
|
-
} & WrappedComponentProps>> & {
|
|
22
|
-
WrappedComponent: React.ComponentType<{
|
|
23
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
24
|
-
items: MenuItemsType;
|
|
25
|
-
onItemActivated?: (attrs: {
|
|
26
|
-
item: MenuItem;
|
|
27
|
-
shouldCloseMenu?: boolean;
|
|
28
|
-
}) => void;
|
|
29
|
-
} & WrappedComponentProps>;
|
|
30
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
4
|
-
type SelectionExtensionDropdownMenuButtonProps = React.ComponentProps<typeof ToolbarButton> & WrappedComponentProps;
|
|
5
|
-
export declare const SelectionExtensionDropdownMenuButton: React.FC<WithIntlProps<SelectionExtensionDropdownMenuButtonProps>> & {
|
|
6
|
-
WrappedComponent: React.ComponentType<SelectionExtensionDropdownMenuButtonProps>;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
11
|
-
import type { SelectionExtension } from '../../types';
|
|
12
|
-
type SelectionExtensionItemsProps = {
|
|
13
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
14
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
15
|
-
editorView: EditorView;
|
|
16
|
-
extensions: SelectionExtension[];
|
|
17
|
-
onExtensionClick: (extension: SelectionExtension) => void;
|
|
18
|
-
} & WrappedComponentProps;
|
|
19
|
-
export declare const SelectionExtensionItemsComponent: ({ extensions, onExtensionClick, editorAnalyticsAPI, }: SelectionExtensionItemsProps) => React.JSX.Element;
|
|
20
|
-
export declare const SelectionExtensionItems: React.FC<WithIntlProps<SelectionExtensionItemsProps>> & {
|
|
21
|
-
WrappedComponent: React.ComponentType<SelectionExtensionItemsProps>;
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
4
|
-
import type { ExtensionMenuItemConfiguration } from '../../types';
|
|
5
|
-
type MenuItemProps = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
extensionMenuItems: ExtensionMenuItemConfiguration[];
|
|
8
|
-
};
|
|
9
|
-
export declare const MenuItem: ({ extensionMenuItems, api }: MenuItemProps) => React.JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
4
|
-
import type { ExtensionToolbarItemConfiguration } from '../../types';
|
|
5
|
-
type ToolbarButtonProps = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
config: ExtensionToolbarItemConfiguration;
|
|
8
|
-
};
|
|
9
|
-
export declare const ToolbarButton: ({ api, config }: ToolbarButtonProps) => React.JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
4
|
-
import type { ExtensionToolbarItemConfiguration } from '../../types';
|
|
5
|
-
type ToolbarMenuProps = React.PropsWithChildren<{
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
config: ExtensionToolbarItemConfiguration;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const ToolbarMenu: ({ api, config, children, }: ToolbarMenuProps) => React.JSX.Element | null;
|
|
10
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
4
|
-
import type { ExtensionConfiguration } from '../../types';
|
|
5
|
-
type RegisterExtensionProps = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
extension: ExtensionConfiguration;
|
|
8
|
-
index: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const registerInlineToolbar: ({ api, extension, index, }: RegisterExtensionProps) => RegisterComponent[];
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../selectionExtensionPluginType';
|
|
4
|
-
import type { SelectionExtensionPluginOptions } from '../types';
|
|
5
|
-
type GetToolbarComponentsProps = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
config: SelectionExtensionPluginOptions | undefined;
|
|
8
|
-
};
|
|
9
|
-
type GetToolbarComponents = (props: GetToolbarComponentsProps) => RegisterComponent[];
|
|
10
|
-
export declare const getToolbarComponents: GetToolbarComponents;
|
|
11
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ExtensionMenuItemConfiguration, ExtensionNestedDropdownMenuConfiguration } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Type guard to check if the given configuration is for a dropdown menu.
|
|
4
|
-
*
|
|
5
|
-
* @param item - The menu item configuration to check, either menu item or dropdown menu
|
|
6
|
-
* @returns True if the item configuration is for a dropdown menu, false otherwise
|
|
7
|
-
*/
|
|
8
|
-
export declare const isNestedDropdownMenuConfiguration: (item: ExtensionMenuItemConfiguration) => item is ExtensionNestedDropdownMenuConfiguration;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
3
|
-
import type { ExtensionMenuItemConfiguration, SelectionExtension } from '../../types';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* TODO: ED-29157 - remove once Confluence migrates to `extensionList`API
|
|
7
|
-
*
|
|
8
|
-
* NOTES:
|
|
9
|
-
* - This is temporary until we deprecate SelectionExtension and DynamicSelectionExtension.
|
|
10
|
-
* - Only supporing SelectionExtension as DynamicSelectionExtension is not being used and will be deprecated.
|
|
11
|
-
*
|
|
12
|
-
* Converts a SelectionExtension -> ExtensionMenuItemConfiguration. This allows existing extensions to appear in the new toolbar.
|
|
13
|
-
*/
|
|
14
|
-
export declare const migrateSelectionExtensionToMenuItem: (extension: SelectionExtension, api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined) => ExtensionMenuItemConfiguration | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { SelectionExtensionPlugin } from '../../selectionExtensionPluginType';
|
|
4
|
-
import type { ExtensionConfiguration } from '../../types';
|
|
5
|
-
type RegisterBlockMenuItemsOptions = {
|
|
6
|
-
api: ExtractInjectionAPI<SelectionExtensionPlugin> | undefined;
|
|
7
|
-
editorViewRef?: {
|
|
8
|
-
current?: EditorView;
|
|
9
|
-
};
|
|
10
|
-
extensionList: ExtensionConfiguration[];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Registers first-party selection extension menu items with the block menu plugin.
|
|
14
|
-
*/
|
|
15
|
-
export declare function registerBlockMenuItems({ extensionList, api, editorViewRef, }: RegisterBlockMenuItemsOptions): void;
|
|
16
|
-
export {};
|