@atlaskit/editor-plugin-block-controls 1.0.0 → 1.2.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 +16 -0
- package/dist/cjs/plugin.js +30 -2
- package/dist/cjs/pm-plugins/decorations.js +50 -0
- package/dist/cjs/pm-plugins/main.js +66 -4
- package/dist/cjs/ui/consts.js +8 -0
- package/dist/cjs/ui/drag-handle-menu.js +15 -0
- package/dist/cjs/ui/drag-handle.js +99 -0
- package/dist/cjs/ui/drag-preview.js +35 -0
- package/dist/cjs/ui/drop-target.js +57 -0
- package/dist/cjs/ui/global-styles.js +19 -0
- package/dist/es2019/plugin.js +29 -3
- package/dist/es2019/pm-plugins/decorations.js +43 -0
- package/dist/es2019/pm-plugins/main.js +66 -5
- package/dist/es2019/ui/consts.js +2 -0
- package/dist/es2019/ui/drag-handle-menu.js +10 -0
- package/dist/es2019/ui/drag-handle.js +90 -0
- package/dist/es2019/ui/drag-preview.js +27 -0
- package/dist/es2019/ui/drop-target.js +39 -0
- package/dist/es2019/ui/global-styles.js +12 -0
- package/dist/esm/plugin.js +30 -3
- package/dist/esm/pm-plugins/decorations.js +43 -0
- package/dist/esm/pm-plugins/main.js +66 -4
- package/dist/esm/ui/consts.js +2 -0
- package/dist/esm/ui/drag-handle-menu.js +8 -0
- package/dist/esm/ui/drag-handle.js +92 -0
- package/dist/esm/ui/drag-preview.js +29 -0
- package/dist/esm/ui/drop-target.js +47 -0
- package/dist/esm/ui/global-styles.js +12 -0
- package/dist/types/pm-plugins/decorations.d.ts +6 -0
- package/dist/types/pm-plugins/main.d.ts +6 -3
- package/dist/types/types.d.ts +11 -2
- package/dist/types/ui/consts.d.ts +2 -0
- package/dist/types/ui/drag-handle-menu.d.ts +6 -0
- package/dist/types/ui/drag-handle.d.ts +9 -0
- package/dist/types/ui/drag-preview.d.ts +1 -0
- package/dist/types/ui/drop-target.d.ts +7 -0
- package/dist/types/ui/global-styles.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +6 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -3
- package/dist/types-ts4.5/types.d.ts +11 -2
- package/dist/types-ts4.5/ui/consts.d.ts +2 -0
- package/dist/types-ts4.5/ui/drag-handle-menu.d.ts +6 -0
- package/dist/types-ts4.5/ui/drag-handle.d.ts +9 -0
- package/dist/types-ts4.5/ui/drag-preview.d.ts +1 -0
- package/dist/types-ts4.5/ui/drop-target.d.ts +7 -0
- package/dist/types-ts4.5/ui/global-styles.d.ts +3 -0
- package/package.json +8 -5
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { EditorCommand, NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
export type ReleaseHiddenDecoration = () => boolean | undefined;
|
|
3
3
|
export type BlockControlsPlugin = NextEditorPlugin<'blockControls', {
|
|
4
4
|
dependencies: [
|
|
5
5
|
];
|
|
6
|
-
sharedState:
|
|
6
|
+
sharedState: {
|
|
7
|
+
isMenuOpen: boolean;
|
|
8
|
+
} | undefined;
|
|
7
9
|
actions: {};
|
|
10
|
+
commands: {
|
|
11
|
+
moveNode: (start: number, end: number, to: number) => EditorCommand;
|
|
12
|
+
};
|
|
8
13
|
}>;
|
|
14
|
+
export interface DraggableSourceData extends Record<string | symbol, unknown> {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { BlockControlsPlugin } from '../types';
|
|
4
|
+
export declare const DragHandleMenu: ({ api, }: {
|
|
5
|
+
api: ExtractInjectionAPI<BlockControlsPlugin> | undefined;
|
|
6
|
+
}) => JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { BlockControlsPlugin } from '../types';
|
|
4
|
+
export declare const DragHandle: ({ dom, api, start, end, }: {
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
api: ExtractInjectionAPI<BlockControlsPlugin> | undefined;
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
}) => jsx.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dragPreview: (container: HTMLElement, domRef: React.MutableRefObject<HTMLElement>) => () => HTMLElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { BlockControlsPlugin } from '../types';
|
|
4
|
+
export declare const DropTarget: ({ api, pos, }: {
|
|
5
|
+
api: ExtractInjectionAPI<BlockControlsPlugin> | undefined;
|
|
6
|
+
pos: number;
|
|
7
|
+
}) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,12 +31,15 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^78.
|
|
35
|
-
"@atlaskit/editor-prosemirror": "
|
|
36
|
-
"@
|
|
34
|
+
"@atlaskit/editor-common": "^78.33.0",
|
|
35
|
+
"@atlaskit/editor-prosemirror": "4.0.0",
|
|
36
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
|
|
37
|
+
"@babel/runtime": "^7.0.0",
|
|
38
|
+
"@emotion/react": "^11.7.1"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
|
-
"react": "^16.8.0"
|
|
41
|
+
"react": "^16.8.0",
|
|
42
|
+
"react-dom": "^16.8.0"
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0"
|