@atlaskit/editor-plugin-block-controls 12.4.1 → 13.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 +38 -0
- package/block-decoration-utils/anchor-name/package.json +1 -8
- package/block-decoration-utils/consts/package.json +1 -8
- package/block-decoration-utils/dom-attr-name/package.json +1 -8
- package/block-decoration-utils/drag-handle-positions/package.json +1 -8
- package/block-decoration-utils/package.json +1 -8
- package/block-decoration-utils/visibility-container/package.json +1 -8
- package/block-decoration-utils/widget-positions/package.json +1 -8
- package/blockControlsPlugin/package.json +1 -8
- package/blockControlsPluginType/package.json +1 -8
- package/dist/cjs/blockControlsPlugin.js +1 -1
- package/dist/cjs/pm-plugins/interaction-tracking/constants.js +8 -0
- package/dist/cjs/pm-plugins/interaction-tracking/handle-mouse-move.js +102 -14
- package/dist/cjs/pm-plugins/interaction-tracking/pm-plugin.js +44 -10
- package/dist/cjs/ui/visibility-container.js +2 -0
- package/dist/es2019/blockControlsPlugin.js +1 -1
- package/dist/es2019/pm-plugins/interaction-tracking/constants.js +2 -0
- package/dist/es2019/pm-plugins/interaction-tracking/handle-mouse-move.js +86 -13
- package/dist/es2019/pm-plugins/interaction-tracking/pm-plugin.js +44 -11
- package/dist/es2019/ui/visibility-container.js +2 -0
- package/dist/esm/blockControlsPlugin.js +1 -1
- package/dist/esm/pm-plugins/interaction-tracking/constants.js +2 -0
- package/dist/esm/pm-plugins/interaction-tracking/handle-mouse-move.js +102 -14
- package/dist/esm/pm-plugins/interaction-tracking/pm-plugin.js +44 -10
- package/dist/esm/ui/visibility-container.js +2 -0
- package/dist/types/pm-plugins/interaction-tracking/constants.d.ts +2 -0
- package/dist/types/pm-plugins/interaction-tracking/handle-mouse-move.d.ts +3 -1
- package/dist/types/pm-plugins/interaction-tracking/pm-plugin.d.ts +3 -1
- package/package.json +37 -41
- package/dist/types-ts4.5/blockControlsPlugin.d.ts +0 -2
- package/dist/types-ts4.5/blockControlsPluginType.d.ts +0 -250
- package/dist/types-ts4.5/editor-commands/handle-key-down-with-preserved-selection.d.ts +0 -17
- package/dist/types-ts4.5/editor-commands/map-preserved-selection.d.ts +0 -13
- package/dist/types-ts4.5/editor-commands/move-node-with-block-menu.d.ts +0 -4
- package/dist/types-ts4.5/editor-commands/move-node.d.ts +0 -5
- package/dist/types-ts4.5/editor-commands/move-to-layout.d.ts +0 -7
- package/dist/types-ts4.5/editor-commands/show-drag-handle.d.ts +0 -3
- package/dist/types-ts4.5/editor-commands/utils/move-node-utils.d.ts +0 -31
- package/dist/types-ts4.5/entry-points/block-decoration-utils-anchor-name.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/block-decoration-utils-consts.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/block-decoration-utils-dom-attr-name.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/block-decoration-utils-drag-handle-positions.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/block-decoration-utils-visibility-container.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/block-decoration-utils-widget-positions.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/blockControlsPlugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/blockControlsPluginType.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/decorations-anchor.d.ts +0 -15
- package/dist/types-ts4.5/pm-plugins/decorations-common.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +0 -30
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target-active.d.ts +0 -13
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +0 -21
- package/dist/types-ts4.5/pm-plugins/decorations-find-surrounding-nodes.d.ts +0 -22
- package/dist/types-ts4.5/pm-plugins/decorations-quick-insert-button.d.ts +0 -30
- package/dist/types-ts4.5/pm-plugins/first-node-dec-plugin.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/handle-mouse-down.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/handle-mouse-over.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/interaction-tracking/commands.d.ts +0 -7
- package/dist/types-ts4.5/pm-plugins/interaction-tracking/handle-key-down.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/interaction-tracking/handle-mouse-move.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/interaction-tracking/pm-plugin.d.ts +0 -20
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -63
- package/dist/types-ts4.5/pm-plugins/quick-insert-calculate-position.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/selection-preservation/editor-commands.d.ts +0 -13
- package/dist/types-ts4.5/pm-plugins/selection-preservation/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/selection-preservation/pm-plugin.d.ts +0 -35
- package/dist/types-ts4.5/pm-plugins/selection-preservation/types.d.ts +0 -7
- package/dist/types-ts4.5/pm-plugins/selection-preservation/utils.d.ts +0 -30
- package/dist/types-ts4.5/pm-plugins/utils/active-anchor-tracker.d.ts +0 -16
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/utils/anchor-utils.d.ts +0 -27
- package/dist/types-ts4.5/pm-plugins/utils/check-fragment.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/utils/check-media-layout.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/utils/consts.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/utils/drag-handle-positions.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/utils/expand-and-update-selection.d.ts +0 -20
- package/dist/types-ts4.5/pm-plugins/utils/getNestedNodePosition.d.ts +0 -16
- package/dist/types-ts4.5/pm-plugins/utils/getSelection.d.ts +0 -32
- package/dist/types-ts4.5/pm-plugins/utils/inline-drop-target.d.ts +0 -7
- package/dist/types-ts4.5/pm-plugins/utils/marks.d.ts +0 -25
- package/dist/types-ts4.5/pm-plugins/utils/remove-from-source.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/utils/selection.d.ts +0 -71
- package/dist/types-ts4.5/pm-plugins/utils/transactions.d.ts +0 -31
- package/dist/types-ts4.5/pm-plugins/utils/update-column-widths.d.ts +0 -6
- package/dist/types-ts4.5/pm-plugins/utils/update-selection.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/utils/validation.d.ts +0 -24
- package/dist/types-ts4.5/pm-plugins/utils/widget-positions.d.ts +0 -14
- package/dist/types-ts4.5/pm-plugins/vanilla-quick-insert.d.ts +0 -21
- package/dist/types-ts4.5/ui/block-decoration-utils.d.ts +0 -6
- package/dist/types-ts4.5/ui/consts.d.ts +0 -67
- package/dist/types-ts4.5/ui/drag-handle-nested-icon.d.ts +0 -12
- package/dist/types-ts4.5/ui/drag-handle.d.ts +0 -20
- package/dist/types-ts4.5/ui/drag-preview.d.ts +0 -9
- package/dist/types-ts4.5/ui/drop-target-layout.d.ts +0 -18
- package/dist/types-ts4.5/ui/drop-target.d.ts +0 -22
- package/dist/types-ts4.5/ui/global-styles.d.ts +0 -10
- package/dist/types-ts4.5/ui/inline-drop-target.d.ts +0 -7
- package/dist/types-ts4.5/ui/quick-insert-button.d.ts +0 -24
- package/dist/types-ts4.5/ui/utils/anchor-name.d.ts +0 -12
- package/dist/types-ts4.5/ui/utils/document-checks.d.ts +0 -5
- package/dist/types-ts4.5/ui/utils/dom-attr-name.d.ts +0 -5
- package/dist/types-ts4.5/ui/utils/editor-commands.d.ts +0 -2
- package/dist/types-ts4.5/ui/visibility-container.d.ts +0 -16
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ActiveDropTargetNode, BlockControlsMeta, BlockControlsPlugin, MultiSelectDnD, NodeDecorationFactory, PluginState } from '../blockControlsPluginType';
|
|
9
|
-
import { AnchorRectCache } from './utils/anchor-utils';
|
|
10
|
-
export declare const key: PluginKey<PluginState>;
|
|
11
|
-
export interface FlagType {
|
|
12
|
-
toolbarFlagsEnabled: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
|
|
15
|
-
export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape["formatMessage"], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null) => PluginState | {
|
|
16
|
-
activeDropTargetNode: ActiveDropTargetNode | undefined;
|
|
17
|
-
activeNode: any;
|
|
18
|
-
blockMenuOptions: {
|
|
19
|
-
canMoveDown: any;
|
|
20
|
-
canMoveUp: any;
|
|
21
|
-
openedViaKeyboard: any;
|
|
22
|
-
} | undefined;
|
|
23
|
-
decorations: DecorationSet;
|
|
24
|
-
editorHeight: any;
|
|
25
|
-
editorWidthLeft: any;
|
|
26
|
-
editorWidthRight: any;
|
|
27
|
-
isDocSizeLimitEnabled: boolean | null;
|
|
28
|
-
isDragging: any;
|
|
29
|
-
isMenuOpen: boolean | undefined;
|
|
30
|
-
isPMDragging: any;
|
|
31
|
-
isResizerResizing: boolean;
|
|
32
|
-
isSelectedViaDragHandle: any;
|
|
33
|
-
isShiftDown: any;
|
|
34
|
-
lastDragCancelled: any;
|
|
35
|
-
menuTriggerBy: any;
|
|
36
|
-
menuTriggerByNode: any;
|
|
37
|
-
multiSelectDnD: MultiSelectDnD | undefined;
|
|
38
|
-
};
|
|
39
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean) => SafePlugin<PluginState | {
|
|
40
|
-
activeDropTargetNode: ActiveDropTargetNode | undefined;
|
|
41
|
-
activeNode: any;
|
|
42
|
-
blockMenuOptions: {
|
|
43
|
-
canMoveDown: any;
|
|
44
|
-
canMoveUp: any;
|
|
45
|
-
openedViaKeyboard: any;
|
|
46
|
-
} | undefined;
|
|
47
|
-
decorations: DecorationSet;
|
|
48
|
-
editorHeight: any;
|
|
49
|
-
editorWidthLeft: any;
|
|
50
|
-
editorWidthRight: any;
|
|
51
|
-
isDocSizeLimitEnabled: boolean | null;
|
|
52
|
-
isDragging: any;
|
|
53
|
-
isMenuOpen: boolean | undefined;
|
|
54
|
-
isPMDragging: any;
|
|
55
|
-
isResizerResizing: boolean;
|
|
56
|
-
isSelectedViaDragHandle: any;
|
|
57
|
-
isShiftDown: any;
|
|
58
|
-
lastDragCancelled: any;
|
|
59
|
-
menuTriggerBy: any;
|
|
60
|
-
menuTriggerByNode: any;
|
|
61
|
-
multiSelectDnD: MultiSelectDnD | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
export declare const getBlockControlsMeta: (tr: Transaction | ReadonlyTransaction) => BlockControlsMeta | undefined;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { AnchorRectCache } from './utils/anchor-utils';
|
|
4
|
-
export declare const calculatePosition: ({ rootAnchorName, anchorName, view, getPos, rootNodeType, macroInteractionUpdates, anchorRectCache, }: {
|
|
5
|
-
anchorName: string;
|
|
6
|
-
anchorRectCache: AnchorRectCache | undefined;
|
|
7
|
-
getPos: () => number | undefined;
|
|
8
|
-
macroInteractionUpdates: boolean | undefined;
|
|
9
|
-
rootAnchorName: string | undefined;
|
|
10
|
-
rootNodeType: string;
|
|
11
|
-
view: EditorView;
|
|
12
|
-
}) => CSSProperties;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
2
|
-
/**
|
|
3
|
-
* Start preserving the selection when a UI interaction requires it
|
|
4
|
-
*
|
|
5
|
-
* e.g., block menu open, drag-and-drop in progress
|
|
6
|
-
*/
|
|
7
|
-
export declare const startPreservingSelection: EditorCommand;
|
|
8
|
-
/**
|
|
9
|
-
* Stop preserving the selection when a UI interaction completes
|
|
10
|
-
*
|
|
11
|
-
* e.g., block menu closed, drag-and-drop ended
|
|
12
|
-
*/
|
|
13
|
-
export declare const stopPreservingSelection: EditorCommand;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
4
|
-
import type { SelectionPreservationPluginState } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Selection Preservation Plugin
|
|
7
|
-
*
|
|
8
|
-
* Used to ensure the selection remains stable across selected nodes during specific UI operations,
|
|
9
|
-
* such as when block menus are open or during drag-and-drop actions.
|
|
10
|
-
*
|
|
11
|
-
* We use a TextSelection to span multi-node selections, however there is a ProseMirror limitation
|
|
12
|
-
* where TextSelection cannot include non inline positions at node boundaries (like media/images).
|
|
13
|
-
*
|
|
14
|
-
* When a selection spans text + media nodes, subsequent transactions cause ProseMirror to collapse
|
|
15
|
-
* the selection to the nearest inline position, excluding the media node. This is problematic for
|
|
16
|
-
* features like block menus and drag-and-drop that need stable multi-node selections while performing
|
|
17
|
-
* operations.
|
|
18
|
-
*
|
|
19
|
-
* The plugin works in three phases:
|
|
20
|
-
* (1) Explicitly save a selection via startPreservingSelection() when opening block menus or starting drag operations.
|
|
21
|
-
* (2) Map the saved selection through document changes to keep positions valid.
|
|
22
|
-
* (3) Detect when transactions collapse the selection and restore it via appendTransaction().
|
|
23
|
-
*
|
|
24
|
-
* Stops preserving via stopPreservingSelection() when the menu closes or operation completes.
|
|
25
|
-
*
|
|
26
|
-
* Commands: startPreservingSelection() to begin preservation, stopPreservingSelection() to end it.
|
|
27
|
-
*
|
|
28
|
-
* NOTE: Only use when the UI blocks user selection changes. For example: when a block menu overlay
|
|
29
|
-
* is open (editor becomes non-interactive), during drag-and-drop operations (user is mid-drag), or
|
|
30
|
-
* when modal dialogs are active. In these states, any selection changes are from ProseMirror's
|
|
31
|
-
* internal behavior (not user input) and should be prevented. Do not use during normal editing.
|
|
32
|
-
*
|
|
33
|
-
* https://hello.atlassian.net/wiki/spaces/egcuc/pages/6170822503/Block+Menu+Solution+for+multi-select+and+selection+preservation
|
|
34
|
-
*/
|
|
35
|
-
export declare const createSelectionPreservationPlugin: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => () => SafePlugin<SelectionPreservationPluginState>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { SelectionPreservationMeta } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Detects if any of the transactions include user-driven selection changes.
|
|
6
|
-
*
|
|
7
|
-
* @param transactions The list of transactions to check.
|
|
8
|
-
* @returns True if any transaction includes a user-driven selection change, otherwise false.
|
|
9
|
-
*/
|
|
10
|
-
export declare const hasUserSelectionChange: (transactions: readonly Transaction[]) => boolean;
|
|
11
|
-
export declare const getSelectionPreservationMeta: (tr: Transaction | ReadonlyTransaction) => SelectionPreservationMeta | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Compares two selections for equality based on their from and to positions.
|
|
14
|
-
*
|
|
15
|
-
* @param a The first selection to compare.
|
|
16
|
-
* @param b The second selection to compare.
|
|
17
|
-
* @returns True if both selections are equal, otherwise false.
|
|
18
|
-
*/
|
|
19
|
-
export declare const compareSelections: (a?: Selection, b?: Selection) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Forces the browser's native selection to match ProseMirror's selection state.
|
|
22
|
-
*
|
|
23
|
-
* This is necessary when the editor doesn't have focus (e.g., when block menu is open)
|
|
24
|
-
* but we still need to update the visual selection after moving nodes. Without this,
|
|
25
|
-
* the browser's native selection remains at the old position, causing ghost highlighting.
|
|
26
|
-
*
|
|
27
|
-
* @param selection The current ProseMirror selection state to sync to DOM.
|
|
28
|
-
* @param view The EditorView instance used to convert ProseMirror positions to DOM positions.
|
|
29
|
-
*/
|
|
30
|
-
export declare const syncDOMSelection: (selection: Selection, view: EditorView) => void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'events';
|
|
2
|
-
export declare class ActiveAnchorTracker {
|
|
3
|
-
emitter: EventEmitter | null;
|
|
4
|
-
lastActiveAnchor: string;
|
|
5
|
-
constructor();
|
|
6
|
-
getActiveAnchor(): string;
|
|
7
|
-
subscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
8
|
-
unsubscribe(anchorName: string, callback: (isActive: boolean) => void): void;
|
|
9
|
-
emit(anchorName: string): void;
|
|
10
|
-
reset(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const defaultActiveAnchorTracker: ActiveAnchorTracker;
|
|
13
|
-
export declare const useActiveAnchorTracker: (anchorName: string, activeAnchorTracker?: ActiveAnchorTracker) => [
|
|
14
|
-
boolean,
|
|
15
|
-
() => void
|
|
16
|
-
];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
4
|
-
export declare const attachMoveNodeAnalytics: (tr: Transaction, inputMethod: string, fromDepth: number, fromNodeTypes: string | undefined, toDepth?: number, toNodeType?: string, isSameParent?: boolean, api?: ExtractInjectionAPI<BlockControlsPlugin>, hasSelectedMultipleNodes?: boolean) => boolean | undefined;
|
|
5
|
-
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>, nodeTypes?: string, hasSelectedMultipleNodes?: boolean, columnCount?: number) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Given a range, return distinctive types of node and whether there are multiple nodes in the range
|
|
8
|
-
*/
|
|
9
|
-
export declare const getMultiSelectAnalyticsAttributes: (tr: Transaction, anchor: number, head: number) => {
|
|
10
|
-
hasSelectedMultipleNodes: boolean;
|
|
11
|
-
nodeTypes: string | undefined;
|
|
12
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { MemoizedFn } from 'memoize-one';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
export declare const isAnchorSupported: MemoizedFn<() => boolean>;
|
|
4
|
-
type RectInfo = {
|
|
5
|
-
bottom: number;
|
|
6
|
-
height: number;
|
|
7
|
-
left: number;
|
|
8
|
-
right: number;
|
|
9
|
-
top: number;
|
|
10
|
-
width: number;
|
|
11
|
-
};
|
|
12
|
-
export declare class AnchorRectCache {
|
|
13
|
-
private anchorRectMap;
|
|
14
|
-
private isAnchorSupported;
|
|
15
|
-
private isDirty;
|
|
16
|
-
private view;
|
|
17
|
-
clear(): void;
|
|
18
|
-
private getRects;
|
|
19
|
-
setEditorView(view: EditorView): void;
|
|
20
|
-
getHeight(anchorName: string): number | null;
|
|
21
|
-
getWidth(anchorName: string): number | null;
|
|
22
|
-
getLeft(anchorName: string): number | null;
|
|
23
|
-
getTop(anchorName: string): number | null;
|
|
24
|
-
getRight(anchorName: string): number | null;
|
|
25
|
-
getRect(anchorName: string): RectInfo | null;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Check if the fragment has only one node of the specified type
|
|
4
|
-
*/
|
|
5
|
-
export declare const isFragmentOfType: (fragment: Fragment, type: string) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Check if the fragment contains at least a node of the specified type
|
|
8
|
-
*/
|
|
9
|
-
export declare const containsNodeOfType: (fragment: Fragment, type: string) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AnchorRectCache } from './anchor-utils';
|
|
2
|
-
export declare const getTopPosition: (dom: HTMLElement | null, type?: string) => string;
|
|
3
|
-
export declare const getLeftPosition: (dom: HTMLElement | null, type: string, innerContainer?: HTMLElement | null, macroInteractionUpdates?: boolean, parentType?: string) => string;
|
|
4
|
-
export declare const getNodeHeight: (dom: HTMLElement | null, anchor: string, anchorRectCache?: AnchorRectCache) => number | undefined;
|
|
5
|
-
export declare const shouldBeSticky: (nodeType: string) => boolean;
|
|
6
|
-
export declare const getControlBottomCSSValue: (anchor: string, isSticky: boolean, isTopLevelNode: boolean, isLayoutColumn?: boolean) => {
|
|
7
|
-
bottom: String;
|
|
8
|
-
};
|
|
9
|
-
export declare const getControlHeightCSSValue: (nodeHeight: number, isSticky: boolean, isTopLevelNode: boolean, fallbackPxHeight: string, isLayoutColumn?: boolean) => {
|
|
10
|
-
height: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const shouldMaskNodeControls: (nodeType: string, isTopLevelNode: boolean) => boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { type Selection, type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
4
|
-
export type ExpandAndUpdateSelectionOptions = {
|
|
5
|
-
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
6
|
-
isShiftPressed: boolean;
|
|
7
|
-
nodeType: string;
|
|
8
|
-
selection: Selection;
|
|
9
|
-
startPos: number;
|
|
10
|
-
tr: Transaction;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Updates the transaction's selection based on the clicked drag handle position.
|
|
14
|
-
*
|
|
15
|
-
* - If the clicked handle is within an existing multi-block selection range, the selection
|
|
16
|
-
* is expanded to cover both the existing range and the clicked node's range.
|
|
17
|
-
* - For tables, a table cell selection is used.
|
|
18
|
-
* - Otherwise, selects the single node at the clicked handle position.
|
|
19
|
-
*/
|
|
20
|
-
export declare const expandAndUpdateSelection: ({ tr, selection, startPos, isShiftPressed, nodeType, api, }: ExpandAndUpdateSelectionOptions) => void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const getNestedNodePosition: ({ selection, schema, resolve, }: {
|
|
4
|
-
resolve: (pos: number) => ResolvedPos;
|
|
5
|
-
schema: Schema;
|
|
6
|
-
selection: Selection;
|
|
7
|
-
}) => number;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @returns starting position of nested node that drag handle can be shown next to
|
|
11
|
-
*/
|
|
12
|
-
export declare const getNestedNodeStartingPosition: ({ selection, schema, resolve, }: {
|
|
13
|
-
resolve: (pos: number) => ResolvedPos;
|
|
14
|
-
schema: Schema;
|
|
15
|
-
selection: Selection;
|
|
16
|
-
}) => number;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
6
|
-
export declare const getInlineNodePos: (doc: PMNode, start: number, nodeSize: number) => {
|
|
7
|
-
inlineNodeEndPos: number;
|
|
8
|
-
inlineNodePos: number;
|
|
9
|
-
};
|
|
10
|
-
export declare const isNodeWithCodeBlock: (tr: Transaction, start: number, nodeSize: number) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Gets the appropriate selection for the node at the given start position.
|
|
13
|
-
*
|
|
14
|
-
* @param doc The ProseMirror document.
|
|
15
|
-
* @param selectionEmpty Indicates if the current selection is empty.
|
|
16
|
-
* @param start The start position of the node.
|
|
17
|
-
* @returns The appropriate selection for the node.
|
|
18
|
-
*/
|
|
19
|
-
export declare const newGetSelection: (doc: PMNode, selectionEmpty: boolean, start: number) => false | TextSelection | NodeSelection;
|
|
20
|
-
export declare const getSelection: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => false | TextSelection | NodeSelection;
|
|
21
|
-
export declare const selectNode: (tr: Transaction, start: number, nodeType: string, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
22
|
-
export declare const setCursorPositionAtMovedNode: (tr: Transaction, start: number, api?: ExtractInjectionAPI<BlockControlsPlugin>) => Transaction;
|
|
23
|
-
/**
|
|
24
|
-
* Checks if handle position is with the selection or corresponds to a (partially) selected node
|
|
25
|
-
* @param state
|
|
26
|
-
* @param selection
|
|
27
|
-
* @param handlePos
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
export declare const isHandleCorrelatedToSelection: (state: EditorState, selection: Selection, handlePos: number) => boolean;
|
|
31
|
-
export declare const rootListDepth: (itemPos: ResolvedPos) => number | undefined;
|
|
32
|
-
export declare const rootTaskListDepth: (taskListPos: ResolvedPos) => number | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { ActiveNode } from '../../blockControlsPluginType';
|
|
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, parentNode?: PMNode) => boolean;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
/**
|
|
4
|
-
* Remove this when platform_editor_clean_up_widget_mark_logic is cleaned up.
|
|
5
|
-
*
|
|
6
|
-
* Returns list of block marks on schema that widgets are allowed to render inside
|
|
7
|
-
* Currently
|
|
8
|
-
* - indent
|
|
9
|
-
* - alignment
|
|
10
|
-
* @param state - The editor state
|
|
11
|
-
* @returns The block marks
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const marks = getBlockMarks(state);
|
|
15
|
-
* console.log(marks);
|
|
16
|
-
* // [indent, alignment]
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare const getActiveBlockMarks: (state: EditorState, pos: number) => Mark[];
|
|
20
|
-
/**
|
|
21
|
-
* Returns supported block marks at `pos` only when both adjacent siblings
|
|
22
|
-
* share the exact same set of those marks. Returns `[]` when they differ,
|
|
23
|
-
* so the widget sits outside all mark wrappers and avoids mis-nesting.
|
|
24
|
-
*/
|
|
25
|
-
export declare const getMatchingBlockMarks: (state: EditorState, pos: number, supportedMarkTypes: MarkType[]) => Mark[];
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { CellSelection } from '@atlaskit/editor-tables';
|
|
6
|
-
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
7
|
-
export declare const getMultiSelectionIfPosInside: (api: ExtractInjectionAPI<BlockControlsPlugin>, pos: number, tr?: Transaction) => {
|
|
8
|
-
anchor?: number;
|
|
9
|
-
head?: number;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Given a handle position, returns the from and to positions of the selected content.
|
|
13
|
-
* If the handle position is not in a multi-selection, it returns the node's from and to positions.
|
|
14
|
-
*
|
|
15
|
-
* @param handlePos The position of the handle
|
|
16
|
-
* @param tr The transaction to use for position calculations
|
|
17
|
-
* @param api The BlockControlsPlugin API for accessing shared state
|
|
18
|
-
* @returns from and to positions of the selected content (after expansion)
|
|
19
|
-
*/
|
|
20
|
-
export declare const getSelectedSlicePosition: (handlePos: number, tr: Transaction, api: ExtractInjectionAPI<BlockControlsPlugin>) => {
|
|
21
|
-
from: number;
|
|
22
|
-
to: number;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Takes a position and expands the selection to encompass the node at that position. Ignores empty or out of range selections.
|
|
26
|
-
* Ignores positions that are in text blocks (i.e. not start of a node)
|
|
27
|
-
* @returns TextSelection if expanded, otherwise returns Selection that was passed in.
|
|
28
|
-
*/
|
|
29
|
-
export declare const expandSelectionHeadToNodeAtPos: (selection: Selection, nodePos: number) => Selection;
|
|
30
|
-
/**
|
|
31
|
-
* This swaps the anchor/head for NodeSelections when its anchor > pos.
|
|
32
|
-
* This is because NodeSelection always has an anchor at the start of the node,
|
|
33
|
-
* which may not align with the existing selection.
|
|
34
|
-
*/
|
|
35
|
-
export declare const alignAnchorHeadInDirectionOfPos: (selection: Selection, pos: number) => Selection;
|
|
36
|
-
/**
|
|
37
|
-
* This maps a preserved selection through a transaction, expanding text selections to block boundaries.
|
|
38
|
-
*
|
|
39
|
-
* @param selection The existing preserved selection to map
|
|
40
|
-
* @param tr The transaction to map through
|
|
41
|
-
* @returns The mapped selection or undefined if mapping is not possible
|
|
42
|
-
*/
|
|
43
|
-
export declare const mapPreservedSelection: (selection: Selection, tr: ReadonlyTransaction | Transaction) => Selection | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Adjust selection bounds to exclude nodes where the selection only touches
|
|
46
|
-
* the edge position without selecting any content.
|
|
47
|
-
*
|
|
48
|
-
* Exception: Don't adjust if the selection is inside an empty textblock,
|
|
49
|
-
* as we want to include empty paragraphs in block operations.
|
|
50
|
-
*
|
|
51
|
-
* @param $from The resolved position of the start of the selection
|
|
52
|
-
* @param $to The resolved position of the end of the selection
|
|
53
|
-
* @returns Adjusted $from and $to positions
|
|
54
|
-
*/
|
|
55
|
-
export declare const adjustSelectionBoundsForEdgePositions: ($from: ResolvedPos, $to: ResolvedPos) => {
|
|
56
|
-
$from: ResolvedPos;
|
|
57
|
-
$to: ResolvedPos;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Creates a preserved selection which is expanded to block boundaries.
|
|
61
|
-
*
|
|
62
|
-
* Will return the correct type of selection based on the nodes contained within the
|
|
63
|
-
* expanded selection range.
|
|
64
|
-
*
|
|
65
|
-
* If the selection becomes empty or invalid, it returns undefined.
|
|
66
|
-
*
|
|
67
|
-
* @param $from The resolved position of the start of the selection
|
|
68
|
-
* @param $to The resolved position of the end of the selection
|
|
69
|
-
* @returns A Selection or undefined if selection is invalid
|
|
70
|
-
*/
|
|
71
|
-
export declare const createPreservedSelection: ($from: ResolvedPos, $to: ResolvedPos) => TextSelection | CellSelection | NodeSelection | undefined;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import type { FlagType } from '../main';
|
|
4
|
-
interface TransactionMetadata {
|
|
5
|
-
from: number;
|
|
6
|
-
isAllText: boolean;
|
|
7
|
-
isReplacedWithSameSize: boolean;
|
|
8
|
-
numReplaceSteps: number;
|
|
9
|
-
to: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Checks if step adds inline char
|
|
13
|
-
* @param s
|
|
14
|
-
* @returns True if step adds inline char
|
|
15
|
-
*/
|
|
16
|
-
export declare const isStepText: (s: ReplaceStep) => boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Checks if step is an inline delete/backspace (replace range from -> from + 1 with empty content)
|
|
19
|
-
* @param s
|
|
20
|
-
* @returns True if delete/backspace
|
|
21
|
-
*/
|
|
22
|
-
export declare const isStepDelete: (s: ReplaceStep) => boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Get metadata from the transaction.
|
|
25
|
-
* @param tr
|
|
26
|
-
* @returns Min 'from', max 'to' (from + slice size, or mapped 'to', whichever is larger). If no steps, returns pos range of entire doc.
|
|
27
|
-
* Number of ReplaceStep and ReplaceAroundStep steps 'numReplaceSteps'.
|
|
28
|
-
* 'isAllText' if all steps are represent adding inline text or a backspace/delete or no-op
|
|
29
|
-
*/
|
|
30
|
-
export declare const getTrMetadata: (tr: Transaction | ReadonlyTransaction, flags: FlagType) => TransactionMetadata;
|
|
31
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const updateColumnWidths: (tr: Transaction, layoutNode: PMNode, layoutNodePos: number, childCount: number) => {
|
|
4
|
-
newColumnWidth: number;
|
|
5
|
-
tr: Transaction;
|
|
6
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
export declare const getInsertLayoutStep: (tr: Transaction) => Step | undefined;
|
|
4
|
-
export declare const updateSelection: (tr: Transaction, to: number, insertAtRight?: boolean) => Transaction;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { MemoizedFn } from 'memoize-one';
|
|
2
|
-
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
export declare const isInsideTable: (nodeType: NodeType) => Boolean;
|
|
5
|
-
export declare const isLayoutColumn: (nodeType: NodeType) => Boolean;
|
|
6
|
-
export declare const isDoc: (nodeType: NodeType) => Boolean;
|
|
7
|
-
export declare const isExpand: (nodeType: NodeType) => Boolean;
|
|
8
|
-
export declare const isNestedExpand: (nodeType: NodeType) => Boolean;
|
|
9
|
-
export declare const isFontSizeMarkActive: (node: PMNode) => boolean;
|
|
10
|
-
export declare const isInSameLayout: ($from: ResolvedPos, $to: ResolvedPos) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* This function converts an expand into a nested expand,
|
|
13
|
-
* although it may fail based on the expand's content.
|
|
14
|
-
* @param expandNode the node to transform.
|
|
15
|
-
* @returns an nested expand node
|
|
16
|
-
* @throws RangeError: Invalid content for node nestedExpand
|
|
17
|
-
*/
|
|
18
|
-
export declare const transformExpandToNestedExpand: (expandNode: PMNode) => PMNode | null;
|
|
19
|
-
export declare const transformFragmentExpandToNestedExpand: (fragment: Fragment) => Fragment | null;
|
|
20
|
-
export declare const transformSliceExpandToNestedExpand: (slice: Slice) => Slice | null;
|
|
21
|
-
export declare const memoizedTransformExpandToNestedExpand: MemoizedFn<(node: PMNode) => PMNode | null>;
|
|
22
|
-
export declare const canCreateNodeWithContentInsideAnotherNode: (nodeTypesToCreate: NodeType[], nodeWithTargetFragment: Fragment) => boolean;
|
|
23
|
-
export declare function canMoveNodeToIndex(destParent: PMNode, indexIntoParent: number, srcNode: PMNode, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
24
|
-
export declare function canMoveSliceToIndex(slice: Slice, sliceFromPos: number, sliceToPos: number, destParent: PMNode, indexIntoParent: number, $destNodePos: ResolvedPos, destNode?: PMNode): boolean;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const getLeftPositionForRootElement: (dom: HTMLElement | null, nodeType: string, widgetDimensions: {
|
|
2
|
-
height: number;
|
|
3
|
-
width: number;
|
|
4
|
-
}, innerContainer?: HTMLElement | null, macroInteractionUpdates?: boolean) => string;
|
|
5
|
-
/**
|
|
6
|
-
* Left position (in px) for a widget on the right edge of the block.
|
|
7
|
-
* Mirrors getLeftPositionForRootElement: when innerContainer is set (table, mediaSingle,
|
|
8
|
-
* extension, blockCard, embedCard) use it for the right edge so the button aligns to the
|
|
9
|
-
* content box and does not overlap; otherwise use the block (dom).
|
|
10
|
-
*/
|
|
11
|
-
export declare const getRightPositionForRootElement: (dom: HTMLElement | null, nodeType: string, widgetDimensions: {
|
|
12
|
-
height: number;
|
|
13
|
-
width: number;
|
|
14
|
-
}, innerContainer?: HTMLElement | null, macroInteractionUpdates?: boolean) => string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
5
|
-
import type { AnchorRectCache } from './utils/anchor-utils';
|
|
6
|
-
type VanillaQuickInsertProps = {
|
|
7
|
-
anchorName: string;
|
|
8
|
-
anchorRectCache?: AnchorRectCache;
|
|
9
|
-
api: ExtractInjectionAPI<BlockControlsPlugin>;
|
|
10
|
-
cleanupCallbacks: ((() => void) | undefined)[];
|
|
11
|
-
formatMessage: IntlShape['formatMessage'];
|
|
12
|
-
getPos: () => number | undefined;
|
|
13
|
-
rootAnchorName: string;
|
|
14
|
-
rootNodeType: string;
|
|
15
|
-
view: EditorView;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Create a Node which contains the quick insert button
|
|
19
|
-
*/
|
|
20
|
-
export declare const createVanillaButton: (props: VanillaQuickInsertProps) => Node;
|
|
21
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { VisibilityContainer } from './visibility-container';
|
|
2
|
-
export { refreshAnchorName } from './utils/anchor-name';
|
|
3
|
-
export { getAnchorAttrName } from './utils/dom-attr-name';
|
|
4
|
-
export { rootElementGap, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment, } from './consts';
|
|
5
|
-
export { getControlBottomCSSValue, getControlHeightCSSValue, getNodeHeight, getTopPosition, shouldBeSticky, } from '../pm-plugins/utils/drag-handle-positions';
|
|
6
|
-
export { getRightPositionForRootElement } from '../pm-plugins/utils/widget-positions';
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare const ACTIVE_DRAG_HANDLE_ATTR = "data-active-drag-handle";
|
|
2
|
-
export declare const ACTIVE_QUICK_INSERT_ATTR = "data-active-quick-insert";
|
|
3
|
-
export declare const DRAG_HANDLE_HEIGHT = 24;
|
|
4
|
-
export declare const DRAG_HANDLE_BORDER_RADIUS = 4;
|
|
5
|
-
export declare const DRAG_HANDLE_ZINDEX: number;
|
|
6
|
-
export declare const DRAG_HANDLE_DEFAULT_GAP = 8;
|
|
7
|
-
export declare const DRAG_HANDLE_NARROW_GAP = 4;
|
|
8
|
-
export declare const DRAG_HANDLE_MAX_GAP = 12;
|
|
9
|
-
export declare const DRAG_HANDLE_SYNCED_BLOCK_GAP = 2.5;
|
|
10
|
-
export declare const DRAG_HANDLE_MAX_WIDTH_PLUS_GAP: number;
|
|
11
|
-
export declare const DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT: number;
|
|
12
|
-
export declare const DRAG_HANDLE_H1_TOP_ADJUSTMENT = 5;
|
|
13
|
-
export declare const DRAG_HANDLE_H2_TOP_ADJUSTMENT = 2;
|
|
14
|
-
export declare const DRAG_HANDLE_H3_TOP_ADJUSTMENT = 1;
|
|
15
|
-
export declare const DRAG_HANDLE_H4_TOP_ADJUSTMENT = 3;
|
|
16
|
-
export declare const DRAG_HANDLE_H5_TOP_ADJUSTMENT = 3;
|
|
17
|
-
export declare const DRAG_HANDLE_H6_TOP_ADJUSTMENT = 3;
|
|
18
|
-
export declare const DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = 8;
|
|
19
|
-
export declare const DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = 2;
|
|
20
|
-
export declare const DRAG_HANDLE_PARAGRAPH_SMALL_TOP_ADJUSTMENT = 0;
|
|
21
|
-
export declare const DRAG_HANDLE_WRAPPED_MEDIA_EMBED_TOP_ADJUSTMENT = 8;
|
|
22
|
-
/** We only want to shift-select nodes that are at the top level of a document.
|
|
23
|
-
* This is because funky things happen when selecting inside of tableCells, but we
|
|
24
|
-
* also want to avoid heavily nested cases to descope potential corner cases.
|
|
25
|
-
* Various top level nodes have their selection 'from' at depths other than 0,
|
|
26
|
-
* so we allow for some leniency to capture them all. e.g. Table is depth 3.
|
|
27
|
-
*/
|
|
28
|
-
export declare const DRAG_HANDLE_MAX_SHIFT_CLICK_DEPTH = 3;
|
|
29
|
-
export declare const STICKY_CONTROLS_TOP_MARGIN = 8;
|
|
30
|
-
export declare const STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER = 24;
|
|
31
|
-
export declare const QUICK_INSERT_HEIGHT = 24;
|
|
32
|
-
export declare const QUICK_INSERT_WIDTH = 24;
|
|
33
|
-
export declare const QUICK_INSERT_DIMENSIONS: {
|
|
34
|
-
height: number;
|
|
35
|
-
width: number;
|
|
36
|
-
};
|
|
37
|
-
export declare const QUICK_INSERT_LEFT_OFFSET = 16;
|
|
38
|
-
export declare const dragHandleGap: (nodeType: string, parentNodeType?: string) => number;
|
|
39
|
-
export declare const rootElementGap: (nodeType: string) => number;
|
|
40
|
-
export declare const getNestedNodeLeftPaddingMargin: (nodeType?: string) => "24px" | "8px" | "16px" | "20px" | "28px" | "40px";
|
|
41
|
-
export declare const topPositionAdjustment: (nodeType: string, layout?: string) => number;
|
|
42
|
-
export declare const dropTargetMarginMap: {
|
|
43
|
-
[key: number]: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* This document serves as a quick reference map for correlating various space matches
|
|
47
|
-
* to the table provided above.
|
|
48
|
-
* For instance, the number 1 will correspond to \{0: token('space.0', '0')\}.
|
|
49
|
-
*/
|
|
50
|
-
export declare const spaceLookupMap: {
|
|
51
|
-
[k: string]: string;
|
|
52
|
-
};
|
|
53
|
-
export declare const spacingBetweenNodesForPreview: {
|
|
54
|
-
[key: string]: {
|
|
55
|
-
bottom: string;
|
|
56
|
-
top: string;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
export declare const nodeMargins: {
|
|
60
|
-
[key: string]: {
|
|
61
|
-
bottom: number;
|
|
62
|
-
top: number;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export declare const DEFAULT_COLUMN_DISTRIBUTIONS: {
|
|
66
|
-
[key: number]: number;
|
|
67
|
-
};
|