@atlaskit/editor-plugin-block-controls 2.10.0 → 2.11.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 +19 -0
- package/dist/cjs/pm-plugins/decorations-anchor.js +97 -0
- package/dist/cjs/pm-plugins/decorations-common.js +49 -0
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +88 -0
- package/dist/cjs/pm-plugins/{decorations.js → decorations-drop-target.js} +11 -209
- package/dist/cjs/pm-plugins/main.js +21 -19
- package/dist/cjs/ui/drop-target-v2.js +3 -3
- package/dist/cjs/ui/global-styles.js +101 -86
- package/dist/cjs/ui/inline-drop-target.js +3 -3
- package/dist/es2019/pm-plugins/decorations-anchor.js +89 -0
- package/dist/es2019/pm-plugins/decorations-common.js +31 -0
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +79 -0
- package/dist/es2019/pm-plugins/{decorations.js → decorations-drop-target.js} +6 -193
- package/dist/es2019/pm-plugins/main.js +3 -1
- package/dist/es2019/ui/drop-target-v2.js +1 -1
- package/dist/es2019/ui/global-styles.js +17 -6
- package/dist/es2019/ui/inline-drop-target.js +1 -1
- package/dist/esm/pm-plugins/decorations-anchor.js +90 -0
- package/dist/esm/pm-plugins/decorations-common.js +42 -0
- package/dist/esm/pm-plugins/decorations-drag-handle.js +81 -0
- package/dist/esm/pm-plugins/{decorations.js → decorations-drop-target.js} +6 -204
- package/dist/esm/pm-plugins/main.js +3 -1
- package/dist/esm/ui/drop-target-v2.js +1 -1
- package/dist/esm/ui/global-styles.js +101 -86
- package/dist/esm/ui/inline-drop-target.js +1 -1
- package/dist/types/pm-plugins/decorations-anchor.d.ts +13 -0
- package/dist/types/pm-plugins/decorations-common.d.ts +7 -0
- package/dist/types/pm-plugins/decorations-drag-handle.d.ts +7 -0
- package/dist/types/pm-plugins/decorations-drop-target.d.ts +17 -0
- package/dist/types-ts4.5/pm-plugins/decorations-anchor.d.ts +13 -0
- package/dist/types-ts4.5/pm-plugins/decorations-common.d.ts +7 -0
- package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +7 -0
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +17 -0
- package/package.json +4 -4
- package/dist/types/pm-plugins/decorations.d.ts +0 -35
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +0 -35
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { ActiveNode, BlockControlsPlugin, HandleOptions } from '../types';
|
|
7
|
-
import { type DropTargetProps } from '../ui/drop-target';
|
|
8
|
-
import { type AnchorRectCache } from '../utils/anchor-utils';
|
|
9
|
-
export declare const TYPE_DROP_TARGET_DEC = "drop-target-decoration";
|
|
10
|
-
export declare const TYPE_HANDLE_DEC = "drag-handle";
|
|
11
|
-
export declare const TYPE_NODE_DEC = "node-decoration";
|
|
12
|
-
export declare const getNodeAnchor: (node: PMNode) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Find drop target decorations in the pos range between from and to
|
|
15
|
-
* @param decorations
|
|
16
|
-
* @param from
|
|
17
|
-
* @param to
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
21
|
-
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
22
|
-
/**
|
|
23
|
-
* Find node decorations in the pos range between from and to (non-inclusive)
|
|
24
|
-
* @param decorations
|
|
25
|
-
* @param from
|
|
26
|
-
* @param to
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
export declare const findNodeDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
30
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, 'getPos'>, side?: number, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
31
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
32
|
-
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
33
|
-
export declare const shouldDescendIntoNode: (node: PMNode) => boolean;
|
|
34
|
-
export declare const nodeDecorations: (newState: EditorState, from?: number, to?: number) => Decoration[];
|
|
35
|
-
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, handleOptions?: HandleOptions) => Decoration;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { ActiveNode, BlockControlsPlugin, HandleOptions } from '../types';
|
|
7
|
-
import { type DropTargetProps } from '../ui/drop-target';
|
|
8
|
-
import { type AnchorRectCache } from '../utils/anchor-utils';
|
|
9
|
-
export declare const TYPE_DROP_TARGET_DEC = "drop-target-decoration";
|
|
10
|
-
export declare const TYPE_HANDLE_DEC = "drag-handle";
|
|
11
|
-
export declare const TYPE_NODE_DEC = "node-decoration";
|
|
12
|
-
export declare const getNodeAnchor: (node: PMNode) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Find drop target decorations in the pos range between from and to
|
|
15
|
-
* @param decorations
|
|
16
|
-
* @param from
|
|
17
|
-
* @param to
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
21
|
-
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
22
|
-
/**
|
|
23
|
-
* Find node decorations in the pos range between from and to (non-inclusive)
|
|
24
|
-
* @param decorations
|
|
25
|
-
* @param from
|
|
26
|
-
* @param to
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
export declare const findNodeDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
30
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, 'getPos'>, side?: number, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
31
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
32
|
-
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
33
|
-
export declare const shouldDescendIntoNode: (node: PMNode) => boolean;
|
|
34
|
-
export declare const nodeDecorations: (newState: EditorState, from?: number, to?: number) => Decoration[];
|
|
35
|
-
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, handleOptions?: HandleOptions) => Decoration;
|