@atlaskit/editor-plugin-selection 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/types/pm-plugins/actions.d.ts +2 -2
- package/dist/types/pm-plugins/gap-cursor/actions.d.ts +2 -2
- package/dist/types/pm-plugins/utils.d.ts +1 -1
- package/dist/types/selectionPluginType.d.ts +3 -3
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/gap-cursor/actions.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +1 -1
- package/dist/types-ts4.5/selectionPluginType.d.ts +5 -5
- package/dist/types-ts4.5/types/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 3.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -6,12 +6,12 @@ export declare enum SelectionActionTypes {
|
|
|
6
6
|
SET_RELATIVE_SELECTION = "SET_RELATIVE_SELECTION"
|
|
7
7
|
}
|
|
8
8
|
export interface SetDecorations {
|
|
9
|
-
type: SelectionActionTypes.SET_DECORATIONS;
|
|
10
9
|
decorationSet: DecorationSet;
|
|
11
10
|
selection: Selection;
|
|
11
|
+
type: SelectionActionTypes.SET_DECORATIONS;
|
|
12
12
|
}
|
|
13
13
|
export interface SetRelativeSelection {
|
|
14
|
-
type: SelectionActionTypes.SET_RELATIVE_SELECTION;
|
|
15
14
|
selectionRelativeToNode?: RelativeSelectionPos;
|
|
15
|
+
type: SelectionActionTypes.SET_RELATIVE_SELECTION;
|
|
16
16
|
}
|
|
17
17
|
export type SelectionAction = SetDecorations | SetRelativeSelection;
|
|
@@ -10,14 +10,14 @@ export declare const setSelectionTopLevelBlocks: (tr: Transaction, event: React.
|
|
|
10
10
|
left: number;
|
|
11
11
|
top: number;
|
|
12
12
|
}) => {
|
|
13
|
-
pos: number;
|
|
14
13
|
inside: number;
|
|
14
|
+
pos: number;
|
|
15
15
|
} | null | void, editorFocused: boolean) => void;
|
|
16
16
|
export declare const setCursorForTopLevelBlocks: (event: React.MouseEvent<any>, editorRef: HTMLElement, posAtCoords: (coords: {
|
|
17
17
|
left: number;
|
|
18
18
|
top: number;
|
|
19
19
|
}) => {
|
|
20
|
-
pos: number;
|
|
21
20
|
inside: number;
|
|
21
|
+
pos: number;
|
|
22
22
|
} | null | void, editorFocused: boolean) => Command;
|
|
23
23
|
export declare const hasGapCursorPlugin: (state: EditorState) => boolean;
|
|
@@ -20,8 +20,8 @@ export declare const getNodesToDecorateFromSelection: (selection: Selection, doc
|
|
|
20
20
|
pos: number;
|
|
21
21
|
}[];
|
|
22
22
|
export declare function shouldRecalcDecorations({ oldEditorState, newEditorState, }: {
|
|
23
|
-
oldEditorState: EditorState;
|
|
24
23
|
newEditorState: EditorState;
|
|
24
|
+
oldEditorState: EditorState;
|
|
25
25
|
}): boolean;
|
|
26
26
|
export declare const isSelectableContainerNode: (node?: PmNode | null) => boolean;
|
|
27
27
|
export declare const isSelectableChildNode: (node?: PmNode | null) => boolean;
|
|
@@ -3,13 +3,13 @@ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/
|
|
|
3
3
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
4
4
|
import type { EditorSelectionAPI, SelectionPluginOptions } from './types';
|
|
5
5
|
export type SelectionPlugin = NextEditorPlugin<'selection', {
|
|
6
|
-
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
7
6
|
actions: EditorSelectionAPI;
|
|
8
|
-
dependencies: [OptionalPlugin<InteractionPlugin>];
|
|
9
7
|
commands: {
|
|
10
|
-
displayGapCursor: (toggle: boolean) => EditorCommand;
|
|
11
8
|
clearManualSelection: () => EditorCommand;
|
|
9
|
+
displayGapCursor: (toggle: boolean) => EditorCommand;
|
|
12
10
|
setManualSelection: (anchor: number, head: number) => EditorCommand;
|
|
13
11
|
};
|
|
12
|
+
dependencies: [OptionalPlugin<InteractionPlugin>];
|
|
13
|
+
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
14
14
|
sharedState: SelectionSharedState;
|
|
15
15
|
}>;
|
|
@@ -11,8 +11,8 @@ export declare enum SelectionDirection {
|
|
|
11
11
|
After = 1
|
|
12
12
|
}
|
|
13
13
|
export type SetSelectionRelativeToNode = (props: {
|
|
14
|
-
selectionRelativeToNode?: RelativeSelectionPos;
|
|
15
14
|
selection?: Selection | null;
|
|
15
|
+
selectionRelativeToNode?: RelativeSelectionPos;
|
|
16
16
|
}) => (state: EditorState) => Transaction;
|
|
17
17
|
type SelectionUtilityOptions = {
|
|
18
18
|
/**
|
|
@@ -21,7 +21,6 @@ type SelectionUtilityOptions = {
|
|
|
21
21
|
selection?: Selection;
|
|
22
22
|
};
|
|
23
23
|
export type EditorSelectionAPI = {
|
|
24
|
-
selectNearNode: SetSelectionRelativeToNode;
|
|
25
24
|
/**
|
|
26
25
|
* Gets the current selection fragment.
|
|
27
26
|
* @param props Options to customise the selection fragment
|
|
@@ -36,6 +35,7 @@ export type EditorSelectionAPI = {
|
|
|
36
35
|
* @returns The current selection local IDs as an array of strings.
|
|
37
36
|
*/
|
|
38
37
|
getSelectionLocalIds: (props?: SelectionUtilityOptions) => string[] | null;
|
|
38
|
+
selectNearNode: SetSelectionRelativeToNode;
|
|
39
39
|
};
|
|
40
40
|
export interface SelectionPluginOptions extends LongPressSelectionPluginOptions {
|
|
41
41
|
/**
|
|
@@ -6,12 +6,12 @@ export declare enum SelectionActionTypes {
|
|
|
6
6
|
SET_RELATIVE_SELECTION = "SET_RELATIVE_SELECTION"
|
|
7
7
|
}
|
|
8
8
|
export interface SetDecorations {
|
|
9
|
-
type: SelectionActionTypes.SET_DECORATIONS;
|
|
10
9
|
decorationSet: DecorationSet;
|
|
11
10
|
selection: Selection;
|
|
11
|
+
type: SelectionActionTypes.SET_DECORATIONS;
|
|
12
12
|
}
|
|
13
13
|
export interface SetRelativeSelection {
|
|
14
|
-
type: SelectionActionTypes.SET_RELATIVE_SELECTION;
|
|
15
14
|
selectionRelativeToNode?: RelativeSelectionPos;
|
|
15
|
+
type: SelectionActionTypes.SET_RELATIVE_SELECTION;
|
|
16
16
|
}
|
|
17
17
|
export type SelectionAction = SetDecorations | SetRelativeSelection;
|
|
@@ -10,14 +10,14 @@ export declare const setSelectionTopLevelBlocks: (tr: Transaction, event: React.
|
|
|
10
10
|
left: number;
|
|
11
11
|
top: number;
|
|
12
12
|
}) => {
|
|
13
|
-
pos: number;
|
|
14
13
|
inside: number;
|
|
14
|
+
pos: number;
|
|
15
15
|
} | null | void, editorFocused: boolean) => void;
|
|
16
16
|
export declare const setCursorForTopLevelBlocks: (event: React.MouseEvent<any>, editorRef: HTMLElement, posAtCoords: (coords: {
|
|
17
17
|
left: number;
|
|
18
18
|
top: number;
|
|
19
19
|
}) => {
|
|
20
|
-
pos: number;
|
|
21
20
|
inside: number;
|
|
21
|
+
pos: number;
|
|
22
22
|
} | null | void, editorFocused: boolean) => Command;
|
|
23
23
|
export declare const hasGapCursorPlugin: (state: EditorState) => boolean;
|
|
@@ -20,8 +20,8 @@ export declare const getNodesToDecorateFromSelection: (selection: Selection, doc
|
|
|
20
20
|
pos: number;
|
|
21
21
|
}[];
|
|
22
22
|
export declare function shouldRecalcDecorations({ oldEditorState, newEditorState, }: {
|
|
23
|
-
oldEditorState: EditorState;
|
|
24
23
|
newEditorState: EditorState;
|
|
24
|
+
oldEditorState: EditorState;
|
|
25
25
|
}): boolean;
|
|
26
26
|
export declare const isSelectableContainerNode: (node?: PmNode | null) => boolean;
|
|
27
27
|
export declare const isSelectableChildNode: (node?: PmNode | null) => boolean;
|
|
@@ -3,15 +3,15 @@ import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/
|
|
|
3
3
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
4
4
|
import type { EditorSelectionAPI, SelectionPluginOptions } from './types';
|
|
5
5
|
export type SelectionPlugin = NextEditorPlugin<'selection', {
|
|
6
|
-
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
7
6
|
actions: EditorSelectionAPI;
|
|
8
|
-
dependencies: [
|
|
9
|
-
OptionalPlugin<InteractionPlugin>
|
|
10
|
-
];
|
|
11
7
|
commands: {
|
|
12
|
-
displayGapCursor: (toggle: boolean) => EditorCommand;
|
|
13
8
|
clearManualSelection: () => EditorCommand;
|
|
9
|
+
displayGapCursor: (toggle: boolean) => EditorCommand;
|
|
14
10
|
setManualSelection: (anchor: number, head: number) => EditorCommand;
|
|
15
11
|
};
|
|
12
|
+
dependencies: [
|
|
13
|
+
OptionalPlugin<InteractionPlugin>
|
|
14
|
+
];
|
|
15
|
+
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
16
16
|
sharedState: SelectionSharedState;
|
|
17
17
|
}>;
|
|
@@ -11,8 +11,8 @@ export declare enum SelectionDirection {
|
|
|
11
11
|
After = 1
|
|
12
12
|
}
|
|
13
13
|
export type SetSelectionRelativeToNode = (props: {
|
|
14
|
-
selectionRelativeToNode?: RelativeSelectionPos;
|
|
15
14
|
selection?: Selection | null;
|
|
15
|
+
selectionRelativeToNode?: RelativeSelectionPos;
|
|
16
16
|
}) => (state: EditorState) => Transaction;
|
|
17
17
|
type SelectionUtilityOptions = {
|
|
18
18
|
/**
|
|
@@ -21,7 +21,6 @@ type SelectionUtilityOptions = {
|
|
|
21
21
|
selection?: Selection;
|
|
22
22
|
};
|
|
23
23
|
export type EditorSelectionAPI = {
|
|
24
|
-
selectNearNode: SetSelectionRelativeToNode;
|
|
25
24
|
/**
|
|
26
25
|
* Gets the current selection fragment.
|
|
27
26
|
* @param props Options to customise the selection fragment
|
|
@@ -36,6 +35,7 @@ export type EditorSelectionAPI = {
|
|
|
36
35
|
* @returns The current selection local IDs as an array of strings.
|
|
37
36
|
*/
|
|
38
37
|
getSelectionLocalIds: (props?: SelectionUtilityOptions) => string[] | null;
|
|
38
|
+
selectNearNode: SetSelectionRelativeToNode;
|
|
39
39
|
};
|
|
40
40
|
export interface SelectionPluginOptions extends LongPressSelectionPluginOptions {
|
|
41
41
|
/**
|