@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/plugin.js +30 -2
  3. package/dist/cjs/pm-plugins/decorations.js +50 -0
  4. package/dist/cjs/pm-plugins/main.js +66 -4
  5. package/dist/cjs/ui/consts.js +8 -0
  6. package/dist/cjs/ui/drag-handle-menu.js +15 -0
  7. package/dist/cjs/ui/drag-handle.js +99 -0
  8. package/dist/cjs/ui/drag-preview.js +35 -0
  9. package/dist/cjs/ui/drop-target.js +57 -0
  10. package/dist/cjs/ui/global-styles.js +19 -0
  11. package/dist/es2019/plugin.js +29 -3
  12. package/dist/es2019/pm-plugins/decorations.js +43 -0
  13. package/dist/es2019/pm-plugins/main.js +66 -5
  14. package/dist/es2019/ui/consts.js +2 -0
  15. package/dist/es2019/ui/drag-handle-menu.js +10 -0
  16. package/dist/es2019/ui/drag-handle.js +90 -0
  17. package/dist/es2019/ui/drag-preview.js +27 -0
  18. package/dist/es2019/ui/drop-target.js +39 -0
  19. package/dist/es2019/ui/global-styles.js +12 -0
  20. package/dist/esm/plugin.js +30 -3
  21. package/dist/esm/pm-plugins/decorations.js +43 -0
  22. package/dist/esm/pm-plugins/main.js +66 -4
  23. package/dist/esm/ui/consts.js +2 -0
  24. package/dist/esm/ui/drag-handle-menu.js +8 -0
  25. package/dist/esm/ui/drag-handle.js +92 -0
  26. package/dist/esm/ui/drag-preview.js +29 -0
  27. package/dist/esm/ui/drop-target.js +47 -0
  28. package/dist/esm/ui/global-styles.js +12 -0
  29. package/dist/types/pm-plugins/decorations.d.ts +6 -0
  30. package/dist/types/pm-plugins/main.d.ts +6 -3
  31. package/dist/types/types.d.ts +11 -2
  32. package/dist/types/ui/consts.d.ts +2 -0
  33. package/dist/types/ui/drag-handle-menu.d.ts +6 -0
  34. package/dist/types/ui/drag-handle.d.ts +9 -0
  35. package/dist/types/ui/drag-preview.d.ts +1 -0
  36. package/dist/types/ui/drop-target.d.ts +7 -0
  37. package/dist/types/ui/global-styles.d.ts +3 -0
  38. package/dist/types-ts4.5/pm-plugins/decorations.d.ts +6 -0
  39. package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -3
  40. package/dist/types-ts4.5/types.d.ts +11 -2
  41. package/dist/types-ts4.5/ui/consts.d.ts +2 -0
  42. package/dist/types-ts4.5/ui/drag-handle-menu.d.ts +6 -0
  43. package/dist/types-ts4.5/ui/drag-handle.d.ts +9 -0
  44. package/dist/types-ts4.5/ui/drag-preview.d.ts +1 -0
  45. package/dist/types-ts4.5/ui/drop-target.d.ts +7 -0
  46. package/dist/types-ts4.5/ui/global-styles.d.ts +3 -0
  47. 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: undefined;
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,2 @@
1
+ export declare const DRAG_HANDLE_HEIGHT = 48;
2
+ export declare const DRAG_HANDLE_WIDTH = 24;
@@ -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;
@@ -0,0 +1,3 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ export declare const GlobalStylesWrapper: () => jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "1.0.0",
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.29.0",
35
- "@atlaskit/editor-prosemirror": "3.0.0",
36
- "@babel/runtime": "^7.0.0"
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"