@atlaskit/editor-plugin-block-controls 4.1.8 → 4.1.9
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/cjs/ui/global-styles.js +1 -8
- package/dist/es2019/ui/global-styles.js +1 -11
- package/dist/esm/ui/global-styles.js +1 -8
- package/dist/types/editor-commands/move-node.d.ts +2 -2
- package/dist/types/pm-plugins/decorations-drop-target-active.d.ts +1 -1
- package/dist/types/pm-plugins/decorations-drop-target.d.ts +3 -3
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/utils/active-anchor-tracker.d.ts +0 -3
- package/dist/types/pm-plugins/utils/inline-drop-target.d.ts +5 -1
- package/dist/types/ui/block-menu-items.d.ts +3 -3
- package/dist/types/ui/drop-target-layout.d.ts +1 -1
- package/dist/types/ui/drop-target.d.ts +2 -2
- package/dist/types/ui/inline-drop-target.d.ts +2 -2
- package/dist/types-ts4.5/editor-commands/move-node.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target-active.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/active-anchor-tracker.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/utils/inline-drop-target.d.ts +5 -1
- package/dist/types-ts4.5/ui/block-menu-items.d.ts +3 -3
- package/dist/types-ts4.5/ui/drop-target-layout.d.ts +1 -1
- package/dist/types-ts4.5/ui/drop-target.d.ts +2 -2
- package/dist/types-ts4.5/ui/inline-drop-target.d.ts +2 -2
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 4.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#198359](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/198359)
|
|
8
|
+
[`077794c6e9512`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/077794c6e9512) -
|
|
9
|
+
Remove fg to ensure safari cursor is not hidden due to block controls
|
|
10
|
+
|
|
3
11
|
## 4.1.8
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
11
11
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
12
12
|
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
16
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
@@ -269,12 +268,6 @@ var headingWithIndentationInLayoutStyleFix = (0, _react.css)((0, _defineProperty
|
|
|
269
268
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
270
269
|
marginTop: '0 !important'
|
|
271
270
|
}));
|
|
272
|
-
var withRelativePosStyleLegacy = (0, _react.css)({
|
|
273
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
274
|
-
'.ProseMirror': (0, _defineProperty2.default)({}, "&& ".concat(dragHandlerAnchorSelector), {
|
|
275
|
-
position: 'relative'
|
|
276
|
-
})
|
|
277
|
-
});
|
|
278
271
|
var withRelativePosStyle = (0, _react.css)({
|
|
279
272
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
280
273
|
'.ProseMirror': (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "&& ".concat(dragHandlerAnchorSelector), {
|
|
@@ -316,6 +309,6 @@ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWra
|
|
|
316
309
|
disabled: !(0, _expValEquals.expValEquals)('platform_editor_block_controls_perf_optimization', 'isEnabled', true)
|
|
317
310
|
});
|
|
318
311
|
return (0, _react.jsx)(_react.Global, {
|
|
319
|
-
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, (0, _expValEquals.expValEquals)('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, (0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix,
|
|
312
|
+
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, (0, _expValEquals.expValEquals)('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, (0, _experiments.editorExperiment)('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle]
|
|
320
313
|
});
|
|
321
314
|
};
|
|
@@ -8,7 +8,6 @@ import { tableControlsSpacing } from '@atlaskit/editor-common/styles';
|
|
|
8
8
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
9
9
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
10
10
|
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { layers } from '@atlaskit/theme/constants';
|
|
13
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -299,15 +298,6 @@ const headingWithIndentationInLayoutStyleFix = css({
|
|
|
299
298
|
marginTop: '0 !important'
|
|
300
299
|
}
|
|
301
300
|
});
|
|
302
|
-
const withRelativePosStyleLegacy = css({
|
|
303
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
304
|
-
'.ProseMirror': {
|
|
305
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
306
|
-
[`&& ${dragHandlerAnchorSelector}`]: {
|
|
307
|
-
position: 'relative'
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
301
|
const withRelativePosStyle = css({
|
|
312
302
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
313
303
|
'.ProseMirror': {
|
|
@@ -355,6 +345,6 @@ export const GlobalStylesWrapper = ({
|
|
|
355
345
|
disabled: !expValEquals('platform_editor_block_controls_perf_optimization', 'isEnabled', true)
|
|
356
346
|
});
|
|
357
347
|
return jsx(Global, {
|
|
358
|
-
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, editorExperiment('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix,
|
|
348
|
+
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, editorExperiment('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle]
|
|
359
349
|
});
|
|
360
350
|
};
|
|
@@ -9,7 +9,6 @@ import { tableControlsSpacing } from '@atlaskit/editor-common/styles';
|
|
|
9
9
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
10
10
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/whitespace';
|
|
11
11
|
import { akEditorBreakoutPadding, akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { layers } from '@atlaskit/theme/constants';
|
|
14
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -262,12 +261,6 @@ var headingWithIndentationInLayoutStyleFix = css(_defineProperty({}, "".concat(d
|
|
|
262
261
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
263
262
|
marginTop: '0 !important'
|
|
264
263
|
}));
|
|
265
|
-
var withRelativePosStyleLegacy = css({
|
|
266
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
267
|
-
'.ProseMirror': _defineProperty({}, "&& ".concat(dragHandlerAnchorSelector), {
|
|
268
|
-
position: 'relative'
|
|
269
|
-
})
|
|
270
|
-
});
|
|
271
264
|
var withRelativePosStyle = css({
|
|
272
265
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
273
266
|
'.ProseMirror': _defineProperty(_defineProperty({}, "&& ".concat(dragHandlerAnchorSelector), {
|
|
@@ -309,6 +302,6 @@ export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
|
309
302
|
disabled: !expValEquals('platform_editor_block_controls_perf_optimization', 'isEnabled', true)
|
|
310
303
|
});
|
|
311
304
|
return jsx(Global, {
|
|
312
|
-
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, editorExperiment('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix,
|
|
305
|
+
styles: [globalStyles(), globalDnDStyle, extendedHoverZone(), isDragging && extendedDragZone, expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? extendHoverZoneReduced : undefined, editorExperiment('platform_editor_controls', 'variant1') ? undefined : withInlineNodeStyle, editorExperiment('platform_editor_block_control_optimise_render', true) ? quickInsertStyles : undefined, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, editorExperiment('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, withAnchorNameZindexStyle]
|
|
313
306
|
});
|
|
314
307
|
};
|
|
@@ -2,5 +2,5 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Command, EditorCommand, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { BlockControlsPlugin, MoveNodeMethod } from '../blockControlsPluginType';
|
|
4
4
|
import { DIRECTION } from '../pm-plugins/utils/consts';
|
|
5
|
-
export declare const moveNodeViaShortcut: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION, formatMessage?: IntlShape[
|
|
6
|
-
export declare const moveNode: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape[
|
|
5
|
+
export declare const moveNodeViaShortcut: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION, formatMessage?: IntlShape["formatMessage"]) => Command;
|
|
6
|
+
export declare const moveNode: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape["formatMessage"]) => EditorCommand;
|
|
@@ -7,7 +7,7 @@ import { type Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
import type { ActiveDropTargetNode, ActiveNode, BlockControlsPlugin } from '../blockControlsPluginType';
|
|
8
8
|
import type { AnchorRectCache } from './utils/anchor-utils';
|
|
9
9
|
export declare const canMoveNodeOrSliceToPos: (state: EditorState, node: PMNode, parent: PMNode, index: number, $toPos: ResolvedPos, activeNode?: ActiveNode) => boolean | null;
|
|
10
|
-
export declare const getActiveDropTargetDecorations: (activeDropTargetNode: ActiveDropTargetNode, state: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, existingDecs: Decoration[], formatMessage: IntlShape[
|
|
10
|
+
export declare const getActiveDropTargetDecorations: (activeDropTargetNode: ActiveDropTargetNode, state: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, existingDecs: Decoration[], formatMessage: IntlShape["formatMessage"], nodeViewPortalProviderAPI: PortalProviderAPI, activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache) => {
|
|
11
11
|
decsToAdd: Decoration[];
|
|
12
12
|
decsToRemove: Decoration[];
|
|
13
13
|
};
|
|
@@ -15,6 +15,6 @@ import { type AnchorRectCache } from './utils/anchor-utils';
|
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
18
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps,
|
|
19
|
-
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps,
|
|
20
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape[
|
|
18
|
+
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, "getPos">, nodeViewPortalProviderAPI: PortalProviderAPI, side?: number, anchorRectCache?: AnchorRectCache, isSameLayout?: boolean) => Decoration;
|
|
19
|
+
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps, "getPos">, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
20
|
+
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape["formatMessage"], nodeViewPortalProviderAPI: PortalProviderAPI, activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
@@ -12,7 +12,7 @@ export interface FlagType {
|
|
|
12
12
|
isMultiSelectEnabled: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
|
|
15
|
-
export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
15
|
+
export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
16
16
|
decorations: DecorationSet;
|
|
17
17
|
activeNode: any;
|
|
18
18
|
activeDropTargetNode: ActiveDropTargetNode | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type ActiveNode } from '../../blockControlsPluginType';
|
|
3
|
-
export declare const shouldAllowInlineDropTarget: (isNested: boolean, node?: PMNode,
|
|
3
|
+
export declare const shouldAllowInlineDropTarget: (isNested: boolean, node?: PMNode,
|
|
4
|
+
/**
|
|
5
|
+
* Is the active node in the same layout as the target node
|
|
6
|
+
*/
|
|
7
|
+
isSameLayout?: boolean, activeNode?: ActiveNode) => boolean;
|
|
@@ -6,10 +6,10 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
6
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
9
|
-
export declare const getBlockMenuItems: (formatMessage: IntlShape[
|
|
9
|
+
export declare const getBlockMenuItems: (formatMessage: IntlShape["formatMessage"]) => {
|
|
10
10
|
items: MenuItem[];
|
|
11
11
|
}[];
|
|
12
12
|
export declare const menuItemsCallback: {
|
|
13
|
-
moveUp: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
14
|
-
moveDown: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
13
|
+
moveUp: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"]) => import("@atlaskit/editor-common/types").Command;
|
|
14
|
+
moveDown: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"]) => import("@atlaskit/editor-common/types").Command;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export type DropTargetLayoutProps = {
|
|
|
11
11
|
formatMessage?: IntlShape['formatMessage'];
|
|
12
12
|
};
|
|
13
13
|
export declare const DropTargetLayout: (props: DropTargetLayoutProps & {
|
|
14
|
-
anchorRectCache?: AnchorRectCache
|
|
14
|
+
anchorRectCache?: AnchorRectCache;
|
|
15
15
|
}) => jsx.JSX.Element | null;
|
|
@@ -17,6 +17,6 @@ export type DropTargetProps = {
|
|
|
17
17
|
formatMessage?: IntlShape['formatMessage'];
|
|
18
18
|
};
|
|
19
19
|
export declare const DropTarget: (props: DropTargetProps & {
|
|
20
|
-
anchorRectCache?: AnchorRectCache
|
|
21
|
-
isSameLayout?: boolean
|
|
20
|
+
anchorRectCache?: AnchorRectCache;
|
|
21
|
+
isSameLayout?: boolean;
|
|
22
22
|
}) => jsx.JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { jsx } from '@emotion/react';
|
|
|
2
2
|
import { type AnchorRectCache } from '../pm-plugins/utils/anchor-utils';
|
|
3
3
|
import { type DropTargetProps } from './drop-target';
|
|
4
4
|
export declare const InlineDropTarget: ({ api, nextNode, position, anchorRectCache, getPos, }: DropTargetProps & {
|
|
5
|
-
anchorRectCache?: AnchorRectCache
|
|
6
|
-
position:
|
|
5
|
+
anchorRectCache?: AnchorRectCache;
|
|
6
|
+
position: "left" | "right";
|
|
7
7
|
}) => jsx.JSX.Element;
|
|
@@ -2,5 +2,5 @@ import { type IntlShape } from 'react-intl-next';
|
|
|
2
2
|
import type { Command, EditorCommand, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { BlockControlsPlugin, MoveNodeMethod } from '../blockControlsPluginType';
|
|
4
4
|
import { DIRECTION } from '../pm-plugins/utils/consts';
|
|
5
|
-
export declare const moveNodeViaShortcut: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION, formatMessage?: IntlShape[
|
|
6
|
-
export declare const moveNode: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape[
|
|
5
|
+
export declare const moveNodeViaShortcut: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION, formatMessage?: IntlShape["formatMessage"]) => Command;
|
|
6
|
+
export declare const moveNode: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape["formatMessage"]) => EditorCommand;
|
|
@@ -7,7 +7,7 @@ import { type Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
import type { ActiveDropTargetNode, ActiveNode, BlockControlsPlugin } from '../blockControlsPluginType';
|
|
8
8
|
import type { AnchorRectCache } from './utils/anchor-utils';
|
|
9
9
|
export declare const canMoveNodeOrSliceToPos: (state: EditorState, node: PMNode, parent: PMNode, index: number, $toPos: ResolvedPos, activeNode?: ActiveNode) => boolean | null;
|
|
10
|
-
export declare const getActiveDropTargetDecorations: (activeDropTargetNode: ActiveDropTargetNode, state: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, existingDecs: Decoration[], formatMessage: IntlShape[
|
|
10
|
+
export declare const getActiveDropTargetDecorations: (activeDropTargetNode: ActiveDropTargetNode, state: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, existingDecs: Decoration[], formatMessage: IntlShape["formatMessage"], nodeViewPortalProviderAPI: PortalProviderAPI, activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache) => {
|
|
11
11
|
decsToAdd: Decoration[];
|
|
12
12
|
decsToRemove: Decoration[];
|
|
13
13
|
};
|
|
@@ -15,6 +15,6 @@ import { type AnchorRectCache } from './utils/anchor-utils';
|
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
18
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps,
|
|
19
|
-
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps,
|
|
20
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape[
|
|
18
|
+
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, "getPos">, nodeViewPortalProviderAPI: PortalProviderAPI, side?: number, anchorRectCache?: AnchorRectCache, isSameLayout?: boolean) => Decoration;
|
|
19
|
+
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps, "getPos">, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
20
|
+
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape["formatMessage"], nodeViewPortalProviderAPI: PortalProviderAPI, activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
@@ -12,7 +12,7 @@ export interface FlagType {
|
|
|
12
12
|
isMultiSelectEnabled: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
|
|
15
|
-
export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
15
|
+
export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
16
16
|
decorations: DecorationSet;
|
|
17
17
|
activeNode: any;
|
|
18
18
|
activeDropTargetNode: ActiveDropTargetNode | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { type ActiveNode } from '../../blockControlsPluginType';
|
|
3
|
-
export declare const shouldAllowInlineDropTarget: (isNested: boolean, node?: PMNode,
|
|
3
|
+
export declare const shouldAllowInlineDropTarget: (isNested: boolean, node?: PMNode,
|
|
4
|
+
/**
|
|
5
|
+
* Is the active node in the same layout as the target node
|
|
6
|
+
*/
|
|
7
|
+
isSameLayout?: boolean, activeNode?: ActiveNode) => boolean;
|
|
@@ -6,10 +6,10 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
6
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
9
|
-
export declare const getBlockMenuItems: (formatMessage: IntlShape[
|
|
9
|
+
export declare const getBlockMenuItems: (formatMessage: IntlShape["formatMessage"]) => {
|
|
10
10
|
items: MenuItem[];
|
|
11
11
|
}[];
|
|
12
12
|
export declare const menuItemsCallback: {
|
|
13
|
-
moveUp: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
14
|
-
moveDown: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape[
|
|
13
|
+
moveUp: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"]) => import("@atlaskit/editor-common/types").Command;
|
|
14
|
+
moveDown: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"]) => import("@atlaskit/editor-common/types").Command;
|
|
15
15
|
};
|
|
@@ -11,5 +11,5 @@ export type DropTargetLayoutProps = {
|
|
|
11
11
|
formatMessage?: IntlShape['formatMessage'];
|
|
12
12
|
};
|
|
13
13
|
export declare const DropTargetLayout: (props: DropTargetLayoutProps & {
|
|
14
|
-
anchorRectCache?: AnchorRectCache
|
|
14
|
+
anchorRectCache?: AnchorRectCache;
|
|
15
15
|
}) => jsx.JSX.Element | null;
|
|
@@ -17,6 +17,6 @@ export type DropTargetProps = {
|
|
|
17
17
|
formatMessage?: IntlShape['formatMessage'];
|
|
18
18
|
};
|
|
19
19
|
export declare const DropTarget: (props: DropTargetProps & {
|
|
20
|
-
anchorRectCache?: AnchorRectCache
|
|
21
|
-
isSameLayout?: boolean
|
|
20
|
+
anchorRectCache?: AnchorRectCache;
|
|
21
|
+
isSameLayout?: boolean;
|
|
22
22
|
}) => jsx.JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { jsx } from '@emotion/react';
|
|
|
2
2
|
import { type AnchorRectCache } from '../pm-plugins/utils/anchor-utils';
|
|
3
3
|
import { type DropTargetProps } from './drop-target';
|
|
4
4
|
export declare const InlineDropTarget: ({ api, nextNode, position, anchorRectCache, getPos, }: DropTargetProps & {
|
|
5
|
-
anchorRectCache?: AnchorRectCache
|
|
6
|
-
position:
|
|
5
|
+
anchorRectCache?: AnchorRectCache;
|
|
6
|
+
position: "left" | "right";
|
|
7
7
|
}) => jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.9",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@atlaskit/editor-plugin-user-intent": "^1.1.0",
|
|
45
45
|
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
47
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
47
|
+
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
48
48
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
49
|
-
"@atlaskit/icon": "^27.
|
|
49
|
+
"@atlaskit/icon": "^27.11.0",
|
|
50
50
|
"@atlaskit/link": "^3.2.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
55
55
|
"@atlaskit/primitives": "^14.11.0",
|
|
56
56
|
"@atlaskit/theme": "^19.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^9.26.0",
|
|
58
58
|
"@atlaskit/tokens": "^6.0.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.4.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^107.
|
|
69
|
+
"@atlaskit/editor-common": "^107.20.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -149,9 +149,6 @@
|
|
|
149
149
|
"platform_editor_elements_dnd_multi_select_patch_3": {
|
|
150
150
|
"type": "boolean"
|
|
151
151
|
},
|
|
152
|
-
"platform_editor_fix_safari_cursor_hidden_empty": {
|
|
153
|
-
"type": "boolean"
|
|
154
|
-
},
|
|
155
152
|
"platform_editor_drag_and_drop_perf_analytics": {
|
|
156
153
|
"type": "boolean"
|
|
157
154
|
},
|