@atlaskit/editor-plugin-block-controls 12.4.0 → 12.4.2

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 (86) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/block-decoration-utils/anchor-name/package.json +1 -8
  3. package/block-decoration-utils/consts/package.json +1 -8
  4. package/block-decoration-utils/dom-attr-name/package.json +1 -8
  5. package/block-decoration-utils/drag-handle-positions/package.json +1 -8
  6. package/block-decoration-utils/package.json +1 -8
  7. package/block-decoration-utils/visibility-container/package.json +1 -8
  8. package/block-decoration-utils/widget-positions/package.json +1 -8
  9. package/blockControlsPlugin/package.json +1 -8
  10. package/blockControlsPluginType/package.json +1 -8
  11. package/package.json +3 -3
  12. package/dist/types-ts4.5/blockControlsPlugin.d.ts +0 -2
  13. package/dist/types-ts4.5/blockControlsPluginType.d.ts +0 -250
  14. package/dist/types-ts4.5/editor-commands/handle-key-down-with-preserved-selection.d.ts +0 -17
  15. package/dist/types-ts4.5/editor-commands/map-preserved-selection.d.ts +0 -13
  16. package/dist/types-ts4.5/editor-commands/move-node-with-block-menu.d.ts +0 -4
  17. package/dist/types-ts4.5/editor-commands/move-node.d.ts +0 -5
  18. package/dist/types-ts4.5/editor-commands/move-to-layout.d.ts +0 -7
  19. package/dist/types-ts4.5/editor-commands/show-drag-handle.d.ts +0 -3
  20. package/dist/types-ts4.5/editor-commands/utils/move-node-utils.d.ts +0 -31
  21. package/dist/types-ts4.5/entry-points/block-decoration-utils-anchor-name.d.ts +0 -1
  22. package/dist/types-ts4.5/entry-points/block-decoration-utils-consts.d.ts +0 -1
  23. package/dist/types-ts4.5/entry-points/block-decoration-utils-dom-attr-name.d.ts +0 -1
  24. package/dist/types-ts4.5/entry-points/block-decoration-utils-drag-handle-positions.d.ts +0 -1
  25. package/dist/types-ts4.5/entry-points/block-decoration-utils-visibility-container.d.ts +0 -1
  26. package/dist/types-ts4.5/entry-points/block-decoration-utils-widget-positions.d.ts +0 -1
  27. package/dist/types-ts4.5/entry-points/blockControlsPlugin.d.ts +0 -1
  28. package/dist/types-ts4.5/entry-points/blockControlsPluginType.d.ts +0 -1
  29. package/dist/types-ts4.5/index.d.ts +0 -2
  30. package/dist/types-ts4.5/pm-plugins/decorations-anchor.d.ts +0 -15
  31. package/dist/types-ts4.5/pm-plugins/decorations-common.d.ts +0 -9
  32. package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +0 -30
  33. package/dist/types-ts4.5/pm-plugins/decorations-drop-target-active.d.ts +0 -13
  34. package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +0 -21
  35. package/dist/types-ts4.5/pm-plugins/decorations-find-surrounding-nodes.d.ts +0 -22
  36. package/dist/types-ts4.5/pm-plugins/decorations-quick-insert-button.d.ts +0 -30
  37. package/dist/types-ts4.5/pm-plugins/first-node-dec-plugin.d.ts +0 -5
  38. package/dist/types-ts4.5/pm-plugins/handle-mouse-down.d.ts +0 -4
  39. package/dist/types-ts4.5/pm-plugins/handle-mouse-over.d.ts +0 -4
  40. package/dist/types-ts4.5/pm-plugins/interaction-tracking/commands.d.ts +0 -7
  41. package/dist/types-ts4.5/pm-plugins/interaction-tracking/handle-key-down.d.ts +0 -2
  42. package/dist/types-ts4.5/pm-plugins/interaction-tracking/handle-mouse-move.d.ts +0 -4
  43. package/dist/types-ts4.5/pm-plugins/interaction-tracking/pm-plugin.d.ts +0 -20
  44. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -5
  45. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -63
  46. package/dist/types-ts4.5/pm-plugins/quick-insert-calculate-position.d.ts +0 -12
  47. package/dist/types-ts4.5/pm-plugins/selection-preservation/editor-commands.d.ts +0 -13
  48. package/dist/types-ts4.5/pm-plugins/selection-preservation/plugin-key.d.ts +0 -3
  49. package/dist/types-ts4.5/pm-plugins/selection-preservation/pm-plugin.d.ts +0 -35
  50. package/dist/types-ts4.5/pm-plugins/selection-preservation/types.d.ts +0 -7
  51. package/dist/types-ts4.5/pm-plugins/selection-preservation/utils.d.ts +0 -30
  52. package/dist/types-ts4.5/pm-plugins/utils/active-anchor-tracker.d.ts +0 -16
  53. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -12
  54. package/dist/types-ts4.5/pm-plugins/utils/anchor-utils.d.ts +0 -27
  55. package/dist/types-ts4.5/pm-plugins/utils/check-fragment.d.ts +0 -9
  56. package/dist/types-ts4.5/pm-plugins/utils/check-media-layout.d.ts +0 -2
  57. package/dist/types-ts4.5/pm-plugins/utils/consts.d.ts +0 -2
  58. package/dist/types-ts4.5/pm-plugins/utils/drag-handle-positions.d.ts +0 -12
  59. package/dist/types-ts4.5/pm-plugins/utils/expand-and-update-selection.d.ts +0 -20
  60. package/dist/types-ts4.5/pm-plugins/utils/getNestedNodePosition.d.ts +0 -16
  61. package/dist/types-ts4.5/pm-plugins/utils/getSelection.d.ts +0 -32
  62. package/dist/types-ts4.5/pm-plugins/utils/inline-drop-target.d.ts +0 -7
  63. package/dist/types-ts4.5/pm-plugins/utils/marks.d.ts +0 -25
  64. package/dist/types-ts4.5/pm-plugins/utils/remove-from-source.d.ts +0 -3
  65. package/dist/types-ts4.5/pm-plugins/utils/selection.d.ts +0 -71
  66. package/dist/types-ts4.5/pm-plugins/utils/transactions.d.ts +0 -31
  67. package/dist/types-ts4.5/pm-plugins/utils/update-column-widths.d.ts +0 -6
  68. package/dist/types-ts4.5/pm-plugins/utils/update-selection.d.ts +0 -4
  69. package/dist/types-ts4.5/pm-plugins/utils/validation.d.ts +0 -24
  70. package/dist/types-ts4.5/pm-plugins/utils/widget-positions.d.ts +0 -14
  71. package/dist/types-ts4.5/pm-plugins/vanilla-quick-insert.d.ts +0 -21
  72. package/dist/types-ts4.5/ui/block-decoration-utils.d.ts +0 -6
  73. package/dist/types-ts4.5/ui/consts.d.ts +0 -67
  74. package/dist/types-ts4.5/ui/drag-handle-nested-icon.d.ts +0 -12
  75. package/dist/types-ts4.5/ui/drag-handle.d.ts +0 -20
  76. package/dist/types-ts4.5/ui/drag-preview.d.ts +0 -9
  77. package/dist/types-ts4.5/ui/drop-target-layout.d.ts +0 -18
  78. package/dist/types-ts4.5/ui/drop-target.d.ts +0 -22
  79. package/dist/types-ts4.5/ui/global-styles.d.ts +0 -10
  80. package/dist/types-ts4.5/ui/inline-drop-target.d.ts +0 -7
  81. package/dist/types-ts4.5/ui/quick-insert-button.d.ts +0 -24
  82. package/dist/types-ts4.5/ui/utils/anchor-name.d.ts +0 -12
  83. package/dist/types-ts4.5/ui/utils/document-checks.d.ts +0 -5
  84. package/dist/types-ts4.5/ui/utils/dom-attr-name.d.ts +0 -5
  85. package/dist/types-ts4.5/ui/utils/editor-commands.d.ts +0 -2
  86. package/dist/types-ts4.5/ui/visibility-container.d.ts +0 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 12.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 12.4.0
4
16
 
5
17
  ### Minor Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-anchor-name.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-anchor-name.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-anchor-name.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-consts.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-consts.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-consts.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-dom-attr-name.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-dom-attr-name.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-dom-attr-name.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-drag-handle-positions.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-drag-handle-positions.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-drag-handle-positions.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/ui/block-decoration-utils.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/ui/block-decoration-utils.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/ui/block-decoration-utils.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-visibility-container.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-visibility-container.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-visibility-container.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/block-decoration-utils-widget-positions.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/block-decoration-utils-widget-positions.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/block-decoration-utils-widget-positions.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/blockControlsPlugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/blockControlsPlugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/blockControlsPlugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/blockControlsPluginType.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/blockControlsPluginType.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/blockControlsPluginType.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "12.4.0",
3
+ "version": "12.4.2",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/editor-shared-styles": "^3.11.0",
49
49
  "@atlaskit/editor-tables": "^2.10.0",
50
50
  "@atlaskit/icon": "^35.4.0",
51
- "@atlaskit/icon-lab": "^6.13.0",
51
+ "@atlaskit/icon-lab": "^6.14.0",
52
52
  "@atlaskit/link": "^3.4.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
58
  "@atlaskit/theme": "^25.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^101.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
60
60
  "@atlaskit/tokens": "^13.4.0",
61
61
  "@atlaskit/tooltip": "^22.6.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -1,2 +0,0 @@
1
- import type { BlockControlsPlugin } from './blockControlsPluginType';
2
- export declare const blockControlsPlugin: BlockControlsPlugin;
@@ -1,250 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
- import type { DIRECTION, EditorCommand, NextEditorPlugin, OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
5
- import type { AccessibilityUtilsPlugin } from '@atlaskit/editor-plugin-accessibility-utils';
6
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
8
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
9
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
10
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
11
- import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
12
- import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
13
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
14
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
15
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
16
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
17
- import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
18
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
19
- import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
20
- import type { Mapping } from '@atlaskit/editor-prosemirror/transform';
21
- import type { Decoration, DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
22
- export type ActiveNode = {
23
- anchorName: string;
24
- handleOptions?: HandleOptions;
25
- nodeType: string;
26
- pos: number;
27
- rootAnchorName?: string;
28
- rootNodeType?: string;
29
- rootPos?: number;
30
- };
31
- export type TriggerByNode = {
32
- nodeType: string;
33
- pos: number;
34
- rootPos?: number;
35
- };
36
- export type ActiveDropTargetNode = {
37
- nodeTypeName: string | null;
38
- pos: number;
39
- };
40
- export type MultiSelectDnD = {
41
- anchor: number;
42
- head: number;
43
- textAnchor: number;
44
- textHead: number;
45
- userAnchor: number;
46
- userHead: number;
47
- };
48
- export interface PluginState {
49
- activeDropTargetNode?: ActiveDropTargetNode;
50
- activeNode?: ActiveNode;
51
- blockMenuOptions?: {
52
- canMoveDown?: boolean;
53
- canMoveUp?: boolean;
54
- openedViaKeyboard?: boolean;
55
- };
56
- decorations: DecorationSet;
57
- editorHeight: number;
58
- editorWidthLeft: number;
59
- editorWidthRight: number;
60
- /**
61
- * @private
62
- * @deprecated Doc size limits no longer supported
63
- */
64
- isDocSizeLimitEnabled: boolean | null;
65
- isDragging: boolean;
66
- isMenuOpen?: boolean;
67
- /**
68
- * is dragging the node without using drag handle, i,e, native prosemirror DnD
69
- */
70
- isPMDragging: boolean;
71
- isResizerResizing: boolean;
72
- isSelectedViaDragHandle?: boolean;
73
- isShiftDown?: boolean;
74
- lastDragCancelled: boolean;
75
- menuTriggerBy?: string;
76
- menuTriggerByNode?: TriggerByNode;
77
- multiSelectDnD?: MultiSelectDnD;
78
- preservedSelection?: Selection;
79
- }
80
- export type ReleaseHiddenDecoration = () => boolean | undefined;
81
- export type BlockControlsPluginConfig = {
82
- /** Enable the quick insert plus button icon on the left of the drag handle */
83
- quickInsertButtonEnabled?: boolean;
84
- /** Enable left/right hover split: show left controls when hovering left, right controls when hovering right */
85
- rightSideControlsEnabled?: boolean;
86
- };
87
- export type BlockControlsSharedState = {
88
- activeDropTargetNode?: ActiveDropTargetNode;
89
- activeNode?: ActiveNode;
90
- blockMenuOptions?: {
91
- canMoveDown?: boolean;
92
- canMoveUp?: boolean;
93
- openedViaKeyboard?: boolean;
94
- };
95
- hoverSide?: 'left' | 'right';
96
- isDragging: boolean;
97
- isEditing?: boolean;
98
- isMenuOpen: boolean;
99
- isMouseOut?: boolean;
100
- isPMDragging: boolean;
101
- isSelectedViaDragHandle?: boolean;
102
- isShiftDown?: boolean;
103
- lastDragCancelled: boolean;
104
- menuTriggerBy?: string;
105
- menuTriggerByNode?: TriggerByNode;
106
- multiSelectDnD?: MultiSelectDnD;
107
- preservedSelection?: Selection;
108
- /** Whether left/right hover split is enabled (from plugin config) */
109
- rightSideControlsEnabled?: boolean;
110
- } | undefined;
111
- export type HandleOptions = {
112
- isFocused: boolean;
113
- } | undefined;
114
- /**
115
- * Props passed to custom right-edge button components (e.g. config.rightEdgeButton).
116
- */
117
- export type RightEdgeButtonProps = {
118
- api: PublicPluginAPI<[
119
- BlockControlsPlugin
120
- ]>;
121
- getPos: () => number | undefined;
122
- };
123
- export type NodeDecorationFactoryParams = {
124
- anchorName: string;
125
- editorState: EditorState;
126
- nodeType: string;
127
- nodeViewPortalProviderAPI: PortalProviderAPI;
128
- rootAnchorName?: string;
129
- rootNodeType?: string;
130
- rootPos: number;
131
- };
132
- /**
133
- * When true, this factory's decorations are shown in view mode on block hover
134
- * (without drag handle or quick insert). Used for right-edge controls.
135
- */
136
- export type NodeDecorationFactory = {
137
- create: (params: NodeDecorationFactoryParams) => Decoration;
138
- /**
139
- * Optional filter: when false, the decoration is not created.
140
- * Use for node-type-specific visibility (e.g. Remix button only on remixable blocks).
141
- */
142
- shouldCreate?: (params: NodeDecorationFactoryParams) => boolean;
143
- /** Show this decoration in view mode when hovering over a block */
144
- showInViewMode?: boolean;
145
- type: string;
146
- };
147
- export type MoveNode = (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape['formatMessage']) => EditorCommand;
148
- export type BlockControlsPluginDependencies = [
149
- OptionalPlugin<LimitedModePlugin>,
150
- OptionalPlugin<EditorDisabledPlugin>,
151
- OptionalPlugin<EditorViewModePlugin>,
152
- OptionalPlugin<WidthPlugin>,
153
- OptionalPlugin<FeatureFlagsPlugin>,
154
- OptionalPlugin<AnalyticsPlugin>,
155
- OptionalPlugin<AccessibilityUtilsPlugin>,
156
- OptionalPlugin<QuickInsertPlugin>,
157
- OptionalPlugin<TypeAheadPlugin>,
158
- OptionalPlugin<SelectionPlugin>,
159
- OptionalPlugin<MetricsPlugin>,
160
- OptionalPlugin<InteractionPlugin>,
161
- OptionalPlugin<UserIntentPlugin>,
162
- OptionalPlugin<ToolbarPlugin>
163
- ];
164
- export type BlockControlsPlugin = NextEditorPlugin<'blockControls', {
165
- actions: {
166
- /**
167
- * Returns the text info (length and content) of the block(s) that triggered
168
- * the block menu.
169
- *
170
- * When a preserved (multi-block) selection exists the text spans all selected
171
- * blocks; otherwise the single node at `menuTriggerByNode.pos` is used.
172
- *
173
- * @param editorView – the current editor view.
174
- * @returns An object with `textLength` and `textContent`, or `null` when the
175
- * context cannot be determined.
176
- */
177
- getTextInfo: (editorView: EditorView) => {
178
- textContent: string;
179
- textLength: number;
180
- } | null;
181
- registerNodeDecoration: (factory: NodeDecorationFactory) => void;
182
- unregisterNodeDecoration: (type: string) => void;
183
- };
184
- commands: {
185
- /**
186
- * Updates the transaction's selection based on the clicked drag handle position.
187
- *
188
- * - If the clicked handle is within an existing multi-block selection range, the selection
189
- * is expanded to cover both the existing range and the clicked node's range.
190
- * - For tables, a table cell selection is used.
191
- * - Otherwise, selects the single node at the clicked handle position.
192
- */
193
- expandAndUpdateSelection: (options: {
194
- isShiftPressed: boolean;
195
- nodeType: string;
196
- selection: Selection;
197
- startPos: number;
198
- }) => EditorCommand;
199
- handleKeyDownWithPreservedSelection: (event: KeyboardEvent) => EditorCommand;
200
- mapPreservedSelection: (mapping: Mapping) => EditorCommand;
201
- moveNode: MoveNode;
202
- moveNodeWithBlockMenu: (direction: DIRECTION.UP | DIRECTION.DOWN) => EditorCommand;
203
- /**
204
- * Move a node before (unless `moveToEnd` is set) another node to expand a layout or create a new layout
205
- * @param from position of the node to be moved
206
- * @param to position of the layout/layout column/node to move the node to
207
- * @param options moveToEnd: move the node to after the layout/layout column/another node
208
- * @param options selectMovedNode: select the moved node after moving it
209
- */
210
- moveToLayout: (start: number, to: number, options?: {
211
- moveNodeAtCursorPos?: boolean;
212
- moveToEnd?: boolean;
213
- selectMovedNode?: boolean;
214
- }) => EditorCommand;
215
- setMultiSelectPositions: (anchor?: number, head?: number) => EditorCommand;
216
- setNodeDragged: (getPos: () => number | undefined, anchorName: string, nodeType: string) => EditorCommand;
217
- setSelectedViaDragHandle: (isSelectedViaDragHandle?: boolean) => EditorCommand;
218
- showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: HandleOptions, rootPos?: number, rootAnchorName?: string, rootNodeType?: string) => EditorCommand;
219
- /**
220
- * Starts preserving the current selection across transactions.
221
- * Used when opening block menus, dragging, or other interactions
222
- * where multi-node selections should remain stable.
223
- */
224
- startPreservingSelection: () => EditorCommand;
225
- /**
226
- * Stops preserving the selection, allowing it to change freely.
227
- * Called when block menus close or drag operations end.
228
- */
229
- stopPreservingSelection: () => EditorCommand;
230
- toggleBlockMenu: (options?: {
231
- anchorName?: string;
232
- closeMenu?: boolean;
233
- openedViaKeyboard?: boolean;
234
- triggerByNode?: TriggerByNode;
235
- }) => EditorCommand;
236
- };
237
- dependencies: BlockControlsPluginDependencies;
238
- pluginConfiguration?: BlockControlsPluginConfig;
239
- sharedState: BlockControlsSharedState;
240
- }>;
241
- export type BlockControlsMeta = {
242
- activeNode: ActiveNode;
243
- dom: HTMLElement;
244
- editorBlurred: boolean;
245
- editorHeight: number;
246
- nodeMoved: boolean;
247
- preservedSelectionMapping: Mapping;
248
- type: string;
249
- };
250
- export type MoveNodeMethod = INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT | INPUT_METHOD.BLOCK_MENU;
@@ -1,17 +0,0 @@
1
- import type { EditorCommand, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { BlockControlsPlugin } from '../blockControlsPluginType';
3
- /**
4
- * Handles key presses when a selection is being preserved, when the block menu is open or closed.
5
- *
6
- * Based on the key pressed and whether the block menu is open or closed:
7
- * 1. Handles key presses with custom logic (e.g. delete/backspace)
8
- * 2. Closes the block menu
9
- * 3. Stops preserving the selection
10
- *
11
- * This is used in two places:
12
- * 1. selection preservation plugin when selection is being preserved, and focus is in the editor.
13
- * 2. block menu UI component when focus is in the block menu.
14
- *
15
- * Ensures consistent behaviour for key presses in both scenarios.
16
- */
17
- export declare const handleKeyDownWithPreservedSelection: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (event: KeyboardEvent) => EditorCommand;
@@ -1,13 +0,0 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
2
- import type { Mapping } from '@atlaskit/editor-prosemirror/transform';
3
- /**
4
- * Applies metadata to the transaction which can be used to apply custom mapping
5
- * to the preserved selection.
6
- *
7
- * This can be used when nodes are transformed/moved in a way that natural mapping
8
- * would not correctly update the preserved selection.
9
- *
10
- * @param preservedSelectionMapping The mapping to apply to the preserved selection.
11
- * @returns An editor command that sets the preserved selection mapping in the transaction metadata.
12
- */
13
- export declare const mapPreservedSelection: (mapping: Mapping) => EditorCommand;
@@ -1,4 +0,0 @@
1
- import type { EditorCommand, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import { DIRECTION } from '@atlaskit/editor-common/types';
3
- import type { BlockControlsPlugin } from '../blockControlsPluginType';
4
- export declare const moveNodeWithBlockMenu: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION.UP | DIRECTION.DOWN) => EditorCommand;
@@ -1,5 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import { type Command, type EditorCommand, type ExtractInjectionAPI, DIRECTION } from '@atlaskit/editor-common/types';
3
- import type { BlockControlsPlugin, MoveNodeMethod } from '../blockControlsPluginType';
4
- export declare const moveNodeViaShortcut: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, direction: DIRECTION, formatMessage?: IntlShape["formatMessage"]) => Command;
5
- export declare const moveNode: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (start: number, to: number, inputMethod?: MoveNodeMethod, formatMessage?: IntlShape["formatMessage"]) => EditorCommand;
@@ -1,7 +0,0 @@
1
- import type { EditorCommand, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { BlockControlsPlugin } from '../blockControlsPluginType';
3
- export declare const moveToLayout: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => (from: number, to: number, options?: {
4
- moveNodeAtCursorPos?: boolean;
5
- moveToEnd?: boolean;
6
- selectMovedNode?: boolean;
7
- }) => EditorCommand;
@@ -1,3 +0,0 @@
1
- import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { BlockControlsPlugin } from '../blockControlsPluginType';
3
- export declare const showDragHandleAtSelection: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => Command;
@@ -1,31 +0,0 @@
1
- import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- /**
4
- * Gets the current node position and bounds from the selection using the preserved selection logic.
5
- * This ensures consistency with how the block controls plugin handles selection boundaries.
6
- *
7
- * Special handling for tables: When moving a table as a block, we need the outer table node's
8
- * position, not the internal cell selection that createPreservedSelection returns.
9
- *
10
- * @param selection The current editor selection
11
- * @returns An object with from and to positions, or undefined if selection is invalid
12
- */
13
- export declare const getNodeBoundsFromSelection: (selection: Selection) => {
14
- from: number;
15
- to: number;
16
- } | undefined;
17
- export declare const getPosWhenMoveNodeUp: ($currentNodePos: ResolvedPos, currentNodePos: number) => number;
18
- export declare const getPosWhenMoveNodeDown: ({ $currentNodePos, nodeAfterPos, tr, }: {
19
- $currentNodePos: ResolvedPos;
20
- nodeAfterPos: number;
21
- tr: Transaction;
22
- }) => number;
23
- export declare const getShouldMoveNode: ({ currentNodePos, moveToPos, tr, }: {
24
- currentNodePos: number;
25
- moveToPos: number;
26
- tr: Transaction;
27
- }) => boolean;
28
- export declare const canMoveNodeUpOrDown: (tr: Transaction) => {
29
- moveDown: boolean;
30
- moveUp: boolean;
31
- };
@@ -1 +0,0 @@
1
- export { refreshAnchorName } from '../ui/utils/anchor-name';
@@ -1 +0,0 @@
1
- export { rootElementGap, STICKY_CONTROLS_TOP_MARGIN_FOR_STICKY_HEADER, topPositionAdjustment, } from '../ui/consts';
@@ -1 +0,0 @@
1
- export { getAnchorAttrName } from '../ui/utils/dom-attr-name';
@@ -1 +0,0 @@
1
- export { getControlBottomCSSValue, getControlHeightCSSValue, getNodeHeight, getTopPosition, shouldBeSticky, } from '../pm-plugins/utils/drag-handle-positions';
@@ -1 +0,0 @@
1
- export { VisibilityContainer } from '../ui/visibility-container';
@@ -1 +0,0 @@
1
- export { getRightPositionForRootElement } from '../pm-plugins/utils/widget-positions';
@@ -1 +0,0 @@
1
- export { blockControlsPlugin } from '../blockControlsPlugin';
@@ -1 +0,0 @@
1
- export type { BlockControlsPlugin, BlockControlsPluginConfig, BlockControlsSharedState, HandleOptions, MoveNodeMethod, BlockControlsPluginDependencies, NodeDecorationFactory, NodeDecorationFactoryParams, PluginState, RightEdgeButtonProps, MoveNode, } from '../blockControlsPluginType';
@@ -1,2 +0,0 @@
1
- export { blockControlsPlugin } from './blockControlsPlugin';
2
- export type { BlockControlsPlugin, BlockControlsPluginConfig, BlockControlsSharedState, HandleOptions, MoveNodeMethod, BlockControlsPluginDependencies, NodeDecorationFactory, NodeDecorationFactoryParams, PluginState, RightEdgeButtonProps, MoveNode, } from './blockControlsPluginType';
@@ -1,15 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
- import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
- export declare const IGNORE_NODES_NEXT: string[];
6
- export declare const IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT: string[];
7
- export declare const shouldDescendIntoNode: (node: PMNode) => boolean;
8
- /**
9
- * Find node decorations corresponding to nodes with starting position between from and to (non-inclusive)
10
- * @param from Position to start search from (inclusive)
11
- * @param to Position to end search at (non-inclusive)
12
- * @returns
13
- */
14
- export declare const findNodeDecs: (state: EditorState, decorations: DecorationSet, from?: number, to?: number) => Decoration[];
15
- export declare const nodeDecorations: (newState: EditorState, from?: number, to?: number) => Decoration[];
@@ -1,9 +0,0 @@
1
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- export declare const TYPE_DROP_TARGET_DEC = "drop-target-decoration";
4
- export declare const TYPE_HANDLE_DEC = "drag-handle";
5
- export declare const TYPE_NODE_DEC = "node-decoration";
6
- export declare const NESTED_DEPTH = 100;
7
- export declare const getNodeAnchor: (node: PMNode) => string;
8
- export declare const getNodeTypeWithLevel: (node: PMNode) => string;
9
- export declare const unmountDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, selector: string, key: string) => void;
@@ -1,30 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
- import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
7
- import type { BlockControlsPlugin, HandleOptions } from '../blockControlsPluginType';
8
- import type { AnchorRectCache } from './utils/anchor-utils';
9
- /**
10
- * Creates a Decoration.node that marks the active node with `data-active-drag-handle="true"`.
11
- * The CSS in staticControlsAnchorStyles then applies `anchor-name` to this attribute,
12
- * which is more reliable than the adjacency-selector approach in dragHandlerAnchorStyles.
13
- */
14
- export declare const createActiveDragHandleNodeDecoration: (pos: number, nodeSize: number) => Decoration;
15
- export declare const findActiveDragHandleNodeDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
16
- export declare const emptyParagraphNodeDecorations: () => Decoration;
17
- export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
18
- type DragHandleDecorationParams = {
19
- anchorName: string;
20
- anchorRectCache?: AnchorRectCache;
21
- api: ExtractInjectionAPI<BlockControlsPlugin>;
22
- editorState: EditorState;
23
- formatMessage: IntlShape['formatMessage'];
24
- handleOptions?: HandleOptions;
25
- nodeType: string;
26
- nodeViewPortalProviderAPI: PortalProviderAPI;
27
- pos: number;
28
- };
29
- export declare const dragHandleDecoration: ({ api, formatMessage, pos, anchorName, nodeType, nodeViewPortalProviderAPI, handleOptions, anchorRectCache, editorState, }: DragHandleDecorationParams) => Decoration;
30
- export {};
@@ -1,13 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
5
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
6
- import type { Decoration } from '@atlaskit/editor-prosemirror/view';
7
- import type { ActiveDropTargetNode, ActiveNode, BlockControlsPlugin } from '../blockControlsPluginType';
8
- import type { AnchorRectCache } from './utils/anchor-utils';
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["formatMessage"], nodeViewPortalProviderAPI: PortalProviderAPI, activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache) => {
11
- decsToAdd: Decoration[];
12
- decsToRemove: Decoration[];
13
- };