@atlaskit/editor-plugin-selection 11.0.16 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/package.json +10 -10
- package/selection-plugin/package.json +1 -8
- package/selection-plugin-type/package.json +1 -8
- package/types/package.json +1 -8
- package/dist/types-ts4.5/editor-actions/index.d.ts +0 -5
- package/dist/types-ts4.5/entry-points/selection-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/selection-plugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -2
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -17
- package/dist/types-ts4.5/pm-plugins/auto-expand-selection-range-on-inline-node-key.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/auto-expand-selection-range-on-inline-node-main.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/cursor/ui/hide-cursor-decoration.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/events/create-selection-between.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/events/keydown.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/events/mouseout.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/gap-cursor/actions.d.ts +0 -23
- package/dist/types-ts4.5/pm-plugins/gap-cursor/direction.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/gap-cursor/utils/place-gap-cursor.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/gap-cursor/utils.d.ts +0 -8
- package/dist/types-ts4.5/pm-plugins/gap-cursor-keymap.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/gap-cursor-main.d.ts +0 -8
- package/dist/types-ts4.5/pm-plugins/gap-cursor-plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor/marks-side.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor/ui/mark-boundary-cursor-decoration.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor/utils/active-marks-side.d.ts +0 -18
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor/utils/inline-code-side.d.ts +0 -18
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor-main.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/mark-boundary-cursor-plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +0 -8
- package/dist/types-ts4.5/pm-plugins/reducer.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/selection-main.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -87
- package/dist/types-ts4.5/selectionPlugin.d.ts +0 -3
- package/dist/types-ts4.5/selectionPluginType.d.ts +0 -21
- package/dist/types-ts4.5/types/index.d.ts +0 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 11.0.17
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
|
|
3
35
|
## 11.0.16
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Selection plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
"singleton": true
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atlaskit/editor-json-transformer": "^
|
|
23
|
-
"@atlaskit/editor-plugin-interaction": "^
|
|
24
|
-
"@atlaskit/editor-prosemirror": "^
|
|
25
|
-
"@atlaskit/editor-shared-styles": "^
|
|
26
|
-
"@atlaskit/editor-tables": "^
|
|
27
|
-
"@atlaskit/platform-feature-flags": "^
|
|
28
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
29
|
-
"@atlaskit/tokens": "^
|
|
22
|
+
"@atlaskit/editor-json-transformer": "^9.0.0",
|
|
23
|
+
"@atlaskit/editor-plugin-interaction": "^21.0.0",
|
|
24
|
+
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
25
|
+
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
26
|
+
"@atlaskit/editor-tables": "^3.0.0",
|
|
27
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
28
|
+
"@atlaskit/tmp-editor-statsig": "^104.0.0",
|
|
29
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@atlaskit/editor-common": "^
|
|
33
|
+
"@atlaskit/editor-common": "^116.0.0",
|
|
34
34
|
"react": "^18.2.0"
|
|
35
35
|
},
|
|
36
36
|
"techstack": {
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/selection-plugin.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/selection-plugin.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/selection-plugin.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/selection-plugin.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/selection-plugin.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/selection-plugin-type.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/selection-plugin-type.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/selection-plugin-type.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/selection-plugin-type.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/selection-plugin-type.d.ts"
|
|
15
8
|
}
|
package/types/package.json
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
15
8
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
3
|
-
import type { SelectionPlugin } from '../selectionPluginType';
|
|
4
|
-
export declare const getSelectionFragment: (api: ExtractInjectionAPI<SelectionPlugin> | undefined) => () => JSONNode[] | null;
|
|
5
|
-
export declare const getSelectionLocalIds: (api?: ExtractInjectionAPI<SelectionPlugin>) => () => string[] | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { SelectionPlugin } from '../selectionPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { selectionPlugin } from '../selectionPlugin';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export declare enum SelectionActionTypes {
|
|
5
|
-
SET_DECORATIONS = "SET_DECORATIONS",
|
|
6
|
-
SET_RELATIVE_SELECTION = "SET_RELATIVE_SELECTION"
|
|
7
|
-
}
|
|
8
|
-
export interface SetDecorations {
|
|
9
|
-
decorationSet: DecorationSet;
|
|
10
|
-
selection: Selection;
|
|
11
|
-
type: SelectionActionTypes.SET_DECORATIONS;
|
|
12
|
-
}
|
|
13
|
-
export interface SetRelativeSelection {
|
|
14
|
-
selectionRelativeToNode?: RelativeSelectionPos;
|
|
15
|
-
type: SelectionActionTypes.SET_RELATIVE_SELECTION;
|
|
16
|
-
}
|
|
17
|
-
export type SelectionAction = SetDecorations | SetRelativeSelection;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import type { Command, EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
export declare const selectNearNode: EditorCommandWithMetadata;
|
|
6
|
-
export declare const setSelectionRelativeToNode: (selectionRelativeToNode?: RelativeSelectionPos, selection?: Selection | null) => Command;
|
|
7
|
-
export declare const arrowRight: Command;
|
|
8
|
-
export declare const arrowLeft: Command;
|
|
9
|
-
export declare const setSelectionInsideAtNodeEnd: (selectionRelativeToNode: RelativeSelectionPos, node: PmNode, from: number, to: number) => Command;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export declare const onCreateSelectionBetween: (view: EditorView, $anchor: ResolvedPos, $head: ResolvedPos) => TextSelection | null;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
export declare function isValidSelection(selection: Selection): boolean;
|
|
4
|
-
export declare function onMouseOut(view: EditorView, event: MouseEvent): boolean;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { Direction } from './direction';
|
|
5
|
-
export type DirectionString = 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward';
|
|
6
|
-
export declare const shouldSkipGapCursor: (direction: Direction, state: EditorState, $pos: ResolvedPos) => boolean;
|
|
7
|
-
export declare const arrow: (dir: Direction, endOfTextblock?: (dir: DirectionString, state?: EditorState) => boolean) => Command;
|
|
8
|
-
export declare const deleteNode: (dir: Direction) => Command;
|
|
9
|
-
export declare const setSelectionTopLevelBlocks: (tr: Transaction, event: React.MouseEvent<any>, editorRef: HTMLElement, posAtCoords: (coords: {
|
|
10
|
-
left: number;
|
|
11
|
-
top: number;
|
|
12
|
-
}) => {
|
|
13
|
-
inside: number;
|
|
14
|
-
pos: number;
|
|
15
|
-
} | null | void, editorFocused: boolean) => void;
|
|
16
|
-
export declare const setCursorForTopLevelBlocks: (event: React.MouseEvent<any>, editorRef: HTMLElement, posAtCoords: (coords: {
|
|
17
|
-
left: number;
|
|
18
|
-
top: number;
|
|
19
|
-
}) => {
|
|
20
|
-
inside: number;
|
|
21
|
-
pos: number;
|
|
22
|
-
} | null | void, editorFocused: boolean) => Command;
|
|
23
|
-
export declare const hasGapCursorPlugin: (state: EditorState) => boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare enum Direction {
|
|
2
|
-
UP = "up",
|
|
3
|
-
RIGHT = "right",
|
|
4
|
-
DOWN = "down",
|
|
5
|
-
LEFT = "left",
|
|
6
|
-
BACKWARD = "backward",
|
|
7
|
-
FORWARD = "forward"
|
|
8
|
-
}
|
|
9
|
-
export declare function isBackward(dir: Direction): boolean;
|
|
10
|
-
export declare function isForward(dir: Direction): boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Side } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import type { Node as PMNode, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
export declare const isLeftCursor: (side: Side) => side is Side.LEFT;
|
|
4
|
-
export declare function getMediaNearPos(doc: PMNode, $pos: ResolvedPos, schema: Schema, dir?: number): PMNode | null;
|
|
5
|
-
export declare const isTextBlockNearPos: (doc: PMNode, schema: Schema, $pos: ResolvedPos, dir: number) => boolean;
|
|
6
|
-
export declare function getLayoutModeFromTargetNode(node: PMNode): string;
|
|
7
|
-
export declare const isIgnoredClick: (elem: HTMLElement | null) => boolean | null;
|
|
8
|
-
export declare const getComputedStyleForLayoutMode: (dom: HTMLElement, node: PMNode | undefined | null, style: CSSStyleDeclaration) => CSSStyleDeclaration;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
type GapCursorPluginState = {
|
|
3
|
-
displayGapCursor: boolean;
|
|
4
|
-
hideCursor: boolean;
|
|
5
|
-
selectionIsGapCursor: boolean;
|
|
6
|
-
};
|
|
7
|
-
declare const plugin: SafePlugin<GapCursorPluginState>;
|
|
8
|
-
export default plugin;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { MarksSide } from '../marks-side';
|
|
4
|
-
type GetActiveMarksSideOptions = {
|
|
5
|
-
selection: Selection;
|
|
6
|
-
storedMarks?: readonly Mark[] | null;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Will determine which side of the current selection the mark-boundary-cursor should
|
|
10
|
-
* favour / point towards, based on which marks are currently active and which marks
|
|
11
|
-
* are applied to the nodes to the left and right side of the current selection.
|
|
12
|
-
*
|
|
13
|
-
* @param {Selection} options.selection - The current selection.
|
|
14
|
-
* @param {readonly Mark[] | null} options.storedMarks - Current stored marks, if any.
|
|
15
|
-
* @returns {MarksSide} - The side (left -1, right 1, or none 0) the mark-boundary-cursor should favour.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getActiveMarksSide({ selection, storedMarks, }: GetActiveMarksSideOptions): MarksSide;
|
|
18
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { MarksSide } from '../marks-side';
|
|
3
|
-
type GetInlineCodeCursorSideOptions = {
|
|
4
|
-
leftMarks: readonly Mark[];
|
|
5
|
-
rightMarks: readonly Mark[];
|
|
6
|
-
storedMarks?: readonly Mark[] | null;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Given the marks on the left and right side of the current selection, and the stored
|
|
10
|
-
* marks being updated during a transaction, this function returns the side (-1 = left,
|
|
11
|
-
* 1 = right) for which node the mark boundary cursor decoration should be added
|
|
12
|
-
*
|
|
13
|
-
* This is intended to correct an issue where the default cursor does not render in the
|
|
14
|
-
* expected location when navigating via arrow keys past the boundary of an inline code
|
|
15
|
-
* node
|
|
16
|
-
*/
|
|
17
|
-
export declare function getInlineCodeCursorSide({ leftMarks, rightMarks, storedMarks, }: GetInlineCodeCursorSideOptions): MarksSide;
|
|
18
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
-
import type { SelectionPluginState } from '@atlaskit/editor-common/selection';
|
|
3
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { SelectionAction } from './actions';
|
|
6
|
-
export declare const createCommand: <A = SelectionAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
7
|
-
export declare const getPluginState: (state: EditorState) => SelectionPluginState;
|
|
8
|
-
export declare const createPluginState: (dispatch: Dispatch, initialState: SelectionPluginState | ((state: EditorState) => SelectionPluginState)) => SafeStateField<SelectionPluginState>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import type { SelectionPluginState } from '@atlaskit/editor-common/selection';
|
|
5
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import type { SelectionPlugin } from '../selectionPluginType';
|
|
8
|
-
import type { SelectionPluginOptions } from '../types';
|
|
9
|
-
export declare const getInitialState: (state: EditorState) => SelectionPluginState;
|
|
10
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<SelectionPlugin> | undefined, dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, options?: SelectionPluginOptions) => SafePlugin<SelectionPluginState>;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
export declare const getDecorations: (tr: Transaction | ReadonlyTransaction, manualSelection?: {
|
|
7
|
-
anchor: number;
|
|
8
|
-
head: number;
|
|
9
|
-
}, hideCursor?: boolean, blockSelection?: Selection) => DecorationSet;
|
|
10
|
-
/**
|
|
11
|
-
* Use `getNodesToDecorateFromSelection` to collect and return
|
|
12
|
-
* a list of nodes within the Selection that should have Selection
|
|
13
|
-
* decorations applied. This allows selection styles to be added to
|
|
14
|
-
* nested nodes. It will ignore text nodes as decorations are
|
|
15
|
-
* applied natively and also ignore nodes that don't completely
|
|
16
|
-
* sit within the given `Selection`.
|
|
17
|
-
*/
|
|
18
|
-
export declare const getNodesToDecorateFromSelection: (selection: Selection, doc: PmNode) => {
|
|
19
|
-
node: PmNode;
|
|
20
|
-
pos: number;
|
|
21
|
-
}[];
|
|
22
|
-
export declare function shouldRecalcDecorations({ oldEditorState, newEditorState, }: {
|
|
23
|
-
newEditorState: EditorState;
|
|
24
|
-
oldEditorState: EditorState;
|
|
25
|
-
}): boolean;
|
|
26
|
-
export declare const isSelectableContainerNode: (node?: PmNode | null) => boolean;
|
|
27
|
-
export declare const isSelectableChildNode: (node?: PmNode | null) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Finds closest parent node that is a selectable block container node
|
|
30
|
-
* If it finds a parent that is not selectable but supports gap cursor, will
|
|
31
|
-
* return undefined
|
|
32
|
-
*/
|
|
33
|
-
export declare const findSelectableContainerParent: (selection: Selection) => ContentNodeWithPos | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Finds node before that is a selectable block container node, starting
|
|
36
|
-
* from $pos.depth + 1 and working in
|
|
37
|
-
* If it finds a node that is not selectable but supports gap cursor, will
|
|
38
|
-
* return undefined
|
|
39
|
-
*/
|
|
40
|
-
export declare const findSelectableContainerBefore: ($pos: ResolvedPos, doc: PmNode) => NodeWithPos | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Finds node after that is a selectable block container node, starting
|
|
43
|
-
* from $pos.depth + 1 and working in
|
|
44
|
-
* If it finds a node that is not selectable but supports gap cursor, will
|
|
45
|
-
* return undefined
|
|
46
|
-
*/
|
|
47
|
-
export declare const findSelectableContainerAfter: ($pos: ResolvedPos, doc: PmNode) => NodeWithPos | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Finds first child node that is a selectable block container node OR that
|
|
50
|
-
* supports gap cursor
|
|
51
|
-
*/
|
|
52
|
-
export declare const findFirstChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Finds last child node that is a selectable block container node OR that
|
|
55
|
-
* supports gap cursor
|
|
56
|
-
*/
|
|
57
|
-
export declare const findLastChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
|
|
58
|
-
export declare const isSelectionAtStartOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
59
|
-
export declare const isSelectionAtEndOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Determines if the current selection is inside a list item within a container and not at the end of the parent list.
|
|
62
|
-
*
|
|
63
|
-
* This is useful for handling edge cases where the selection is within a list inside a container structure,
|
|
64
|
-
* and we need to know if the selection is not at the logical end of the parent list node.
|
|
65
|
-
*/
|
|
66
|
-
export declare const isListItemWithinContainerNotAtEnd: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Determines if the given node is a Container (layoutColumn, panel, expand) node.
|
|
69
|
-
*/
|
|
70
|
-
export declare const isContainerNode: (node: PmNode | null | undefined) => boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Finds the top-level List ancestor of the given position.
|
|
73
|
-
* Returns the node and its position if found, otherwise returns undefined.
|
|
74
|
-
*/
|
|
75
|
-
export declare const findTopLevelList: (pos: ResolvedPos) => {
|
|
76
|
-
node: PmNode;
|
|
77
|
-
pos: number;
|
|
78
|
-
} | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Determines whether the current selection position is at the end of a layout column node.
|
|
81
|
-
*/
|
|
82
|
-
export declare const isSelectionAtEndOfLayoutColumn: ($pos: ResolvedPos) => boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Determines if the given node is a LayoutColumn node.
|
|
85
|
-
*/
|
|
86
|
-
export declare const isLayoutColumnNode: (node: PmNode | null | undefined) => boolean;
|
|
87
|
-
export declare const isPanelOrExpandNode: (node: PmNode | null | undefined) => boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { SelectionSharedState } from '@atlaskit/editor-common/selection';
|
|
2
|
-
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
4
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { EditorSelectionAPI, SelectionPluginOptions } from './types';
|
|
6
|
-
export type SelectionPlugin = NextEditorPlugin<'selection', {
|
|
7
|
-
actions: EditorSelectionAPI;
|
|
8
|
-
commands: {
|
|
9
|
-
clearBlockSelection: () => EditorCommand;
|
|
10
|
-
clearManualSelection: () => EditorCommand;
|
|
11
|
-
displayGapCursor: (toggle: boolean) => EditorCommand;
|
|
12
|
-
hideCursor: (hide: boolean) => EditorCommand;
|
|
13
|
-
setBlockSelection: (selection: Selection) => EditorCommand;
|
|
14
|
-
setManualSelection: (anchor: number, head: number) => EditorCommand;
|
|
15
|
-
};
|
|
16
|
-
dependencies: [
|
|
17
|
-
OptionalPlugin<InteractionPlugin>
|
|
18
|
-
];
|
|
19
|
-
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
20
|
-
sharedState: SelectionSharedState;
|
|
21
|
-
}>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { RelativeSelectionPos } from '@atlaskit/editor-common/selection';
|
|
2
|
-
export type { SelectionPluginState } from '@atlaskit/editor-common/selection';
|
|
3
|
-
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
5
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
export declare const selectionPluginKey: PluginKey;
|
|
8
|
-
export { RelativeSelectionPos };
|
|
9
|
-
export declare enum SelectionDirection {
|
|
10
|
-
Before = -1,
|
|
11
|
-
After = 1
|
|
12
|
-
}
|
|
13
|
-
export type SetSelectionRelativeToNode = (props: {
|
|
14
|
-
selection?: Selection | null;
|
|
15
|
-
selectionRelativeToNode?: RelativeSelectionPos;
|
|
16
|
-
}) => (state: EditorState) => Transaction;
|
|
17
|
-
type SelectionUtilityOptions = {
|
|
18
|
-
/**
|
|
19
|
-
* Use a specific selection rather than the current which is the default
|
|
20
|
-
*/
|
|
21
|
-
selection?: Selection;
|
|
22
|
-
};
|
|
23
|
-
export type EditorSelectionAPI = {
|
|
24
|
-
/**
|
|
25
|
-
* Gets the current selection fragment.
|
|
26
|
-
* @param props Options to customise the selection fragment
|
|
27
|
-
* @param props.selection Use a specific selection rather than the current
|
|
28
|
-
* @returns The current selection fragment as an array of JSON nodes.
|
|
29
|
-
*/
|
|
30
|
-
getSelectionFragment: (props?: SelectionUtilityOptions) => JSONNode[] | null;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the current selection local IDs. This includes all local IDs
|
|
33
|
-
* @param props Options to customise the selection fragment
|
|
34
|
-
* @param props.selection Use a specific selection rather than the current
|
|
35
|
-
* @returns The current selection local IDs as an array of strings.
|
|
36
|
-
*/
|
|
37
|
-
getSelectionLocalIds: (props?: SelectionUtilityOptions) => string[] | null;
|
|
38
|
-
selectNearNode: SetSelectionRelativeToNode;
|
|
39
|
-
};
|
|
40
|
-
export interface SelectionPluginOptions extends LongPressSelectionPluginOptions {
|
|
41
|
-
/**
|
|
42
|
-
* There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
|
|
43
|
-
*
|
|
44
|
-
* This is expected to be removed in Q4 as Editor and Live Page teams align on a singular behaviour.
|
|
45
|
-
*
|
|
46
|
-
* It is only supported for use by Confluence.
|
|
47
|
-
*
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
__livePage?: boolean;
|
|
51
|
-
}
|