@atlaskit/editor-plugin-block-controls 2.13.21 → 2.13.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/decorations-common.js +10 -2
- package/dist/cjs/pm-plugins/decorations-drag-handle.js +29 -12
- package/dist/cjs/pm-plugins/decorations-drop-target.js +52 -20
- package/dist/cjs/pm-plugins/handle-mouse-over.js +8 -2
- package/dist/cjs/pm-plugins/main.js +14 -14
- package/dist/es2019/plugin.js +3 -2
- package/dist/es2019/pm-plugins/decorations-common.js +10 -2
- package/dist/es2019/pm-plugins/decorations-drag-handle.js +27 -12
- package/dist/es2019/pm-plugins/decorations-drop-target.js +52 -23
- package/dist/es2019/pm-plugins/handle-mouse-over.js +8 -2
- package/dist/es2019/pm-plugins/main.js +14 -14
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/decorations-common.js +10 -2
- package/dist/esm/pm-plugins/decorations-drag-handle.js +29 -12
- package/dist/esm/pm-plugins/decorations-drop-target.js +52 -20
- package/dist/esm/pm-plugins/handle-mouse-over.js +8 -2
- package/dist/esm/pm-plugins/main.js +14 -14
- package/dist/types/pm-plugins/decorations-common.d.ts +2 -1
- package/dist/types/pm-plugins/decorations-drag-handle.d.ts +2 -1
- package/dist/types/pm-plugins/decorations-drop-target.d.ts +4 -3
- package/dist/types/pm-plugins/main.d.ts +4 -3
- package/dist/types-ts4.5/pm-plugins/decorations-common.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +4 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +4 -3
- package/package.json +5 -2
|
@@ -92,7 +92,7 @@ var initialState = {
|
|
|
92
92
|
isDocSizeLimitEnabled: null,
|
|
93
93
|
isPMDragging: false
|
|
94
94
|
};
|
|
95
|
-
export var newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, anchorRectCache) {
|
|
95
|
+
export var newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
96
96
|
var _meta$activeNode, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _meta$isDragging2, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging;
|
|
97
97
|
var activeNode = currentState.activeNode,
|
|
98
98
|
decorations = currentState.decorations,
|
|
@@ -182,7 +182,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
182
182
|
var _activeNode5, _activeNode6;
|
|
183
183
|
var _oldHandle = findHandleDec(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
|
|
184
184
|
decorations = decorations.remove(_oldHandle);
|
|
185
|
-
var handleDec = dragHandleDecoration(api, formatMessage, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.anchorName, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.nodeType, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.handleOptions);
|
|
185
|
+
var handleDec = dragHandleDecoration(api, formatMessage, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.pos, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.anchorName, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.nodeType, nodeViewPortalProviderAPI, latestActiveNode === null || latestActiveNode === void 0 ? void 0 : latestActiveNode.handleOptions);
|
|
186
186
|
decorations = decorations.add(newState.doc, [handleDec]);
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -190,7 +190,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
190
190
|
var isDropTargetsMissing = ((_meta$isDragging = meta === null || meta === void 0 ? void 0 : meta.isDragging) !== null && _meta$isDragging !== void 0 ? _meta$isDragging : isDragging) && maybeNodeCountChanged && !(meta !== null && meta !== void 0 && meta.nodeMoved);
|
|
191
191
|
|
|
192
192
|
// Remove drop target decorations when dragging stops or they need to be redrawn
|
|
193
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing) {
|
|
193
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing || isBlocksDragTargetDebug()) {
|
|
194
194
|
var dropTargetDecs = findDropTargetDecs(decorations);
|
|
195
195
|
decorations = decorations.remove(dropTargetDecs);
|
|
196
196
|
}
|
|
@@ -198,7 +198,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
198
198
|
// Add drop targets when dragging starts or some are missing
|
|
199
199
|
if (api) {
|
|
200
200
|
if (meta !== null && meta !== void 0 && meta.isDragging || isDropTargetsMissing || isBlocksDragTargetDebug()) {
|
|
201
|
-
var decs = dropTargetDecorations(newState, api, formatMessage, latestActiveNode, anchorRectCache);
|
|
201
|
+
var decs = dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, latestActiveNode, anchorRectCache);
|
|
202
202
|
decorations = decorations.add(newState.doc, decs);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -223,7 +223,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
223
223
|
isPMDragging: (_meta$isPMDragging = meta === null || meta === void 0 ? void 0 : meta.isPMDragging) !== null && _meta$isPMDragging !== void 0 ? _meta$isPMDragging : isPMDragging
|
|
224
224
|
};
|
|
225
225
|
};
|
|
226
|
-
export var oldApply = function oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, anchorRectCache) {
|
|
226
|
+
export var oldApply = function oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
227
227
|
var _meta$activeNode2, _meta$activeNode$hand2, _activeNodeWithNewNod, _meta$activeNode8, _meta$isDragging4, _meta$editorHeight2, _meta$editorWidthLeft2, _meta$editorWidthRigh2, _meta$isPMDragging2;
|
|
228
228
|
var isNestedEnabled = flags.isNestedEnabled;
|
|
229
229
|
var activeNode = currentState.activeNode,
|
|
@@ -328,7 +328,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
328
328
|
var decAtPos = newNodeDecs.find(function (dec) {
|
|
329
329
|
return dec.from === mappedPosisiton;
|
|
330
330
|
});
|
|
331
|
-
draghandleDec = dragHandleDecoration(api, formatMessage, (_meta$activeNode$pos = meta === null || meta === void 0 || (_meta$activeNode3 = meta.activeNode) === null || _meta$activeNode3 === void 0 ? void 0 : _meta$activeNode3.pos) !== null && _meta$activeNode$pos !== void 0 ? _meta$activeNode$pos : mappedPosisiton, (_ref6 = (_meta$activeNode$anch = meta === null || meta === void 0 || (_meta$activeNode4 = meta.activeNode) === null || _meta$activeNode4 === void 0 ? void 0 : _meta$activeNode4.anchorName) !== null && _meta$activeNode$anch !== void 0 ? _meta$activeNode$anch : decAtPos === null || decAtPos === void 0 || (_decAtPos$spec = decAtPos.spec) === null || _decAtPos$spec === void 0 ? void 0 : _decAtPos$spec.anchorName) !== null && _ref6 !== void 0 ? _ref6 : activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName, (_ref7 = (_meta$activeNode$node = meta === null || meta === void 0 || (_meta$activeNode5 = meta.activeNode) === null || _meta$activeNode5 === void 0 ? void 0 : _meta$activeNode5.nodeType) !== null && _meta$activeNode$node !== void 0 ? _meta$activeNode$node : decAtPos === null || decAtPos === void 0 || (_decAtPos$spec2 = decAtPos.spec) === null || _decAtPos$spec2 === void 0 ? void 0 : _decAtPos$spec2.nodeType) !== null && _ref7 !== void 0 ? _ref7 : activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType, meta === null || meta === void 0 || (_meta$activeNode6 = meta.activeNode) === null || _meta$activeNode6 === void 0 ? void 0 : _meta$activeNode6.handleOptions);
|
|
331
|
+
draghandleDec = dragHandleDecoration(api, formatMessage, (_meta$activeNode$pos = meta === null || meta === void 0 || (_meta$activeNode3 = meta.activeNode) === null || _meta$activeNode3 === void 0 ? void 0 : _meta$activeNode3.pos) !== null && _meta$activeNode$pos !== void 0 ? _meta$activeNode$pos : mappedPosisiton, (_ref6 = (_meta$activeNode$anch = meta === null || meta === void 0 || (_meta$activeNode4 = meta.activeNode) === null || _meta$activeNode4 === void 0 ? void 0 : _meta$activeNode4.anchorName) !== null && _meta$activeNode$anch !== void 0 ? _meta$activeNode$anch : decAtPos === null || decAtPos === void 0 || (_decAtPos$spec = decAtPos.spec) === null || _decAtPos$spec === void 0 ? void 0 : _decAtPos$spec.anchorName) !== null && _ref6 !== void 0 ? _ref6 : activeNode === null || activeNode === void 0 ? void 0 : activeNode.anchorName, (_ref7 = (_meta$activeNode$node = meta === null || meta === void 0 || (_meta$activeNode5 = meta.activeNode) === null || _meta$activeNode5 === void 0 ? void 0 : _meta$activeNode5.nodeType) !== null && _meta$activeNode$node !== void 0 ? _meta$activeNode$node : decAtPos === null || decAtPos === void 0 || (_decAtPos$spec2 = decAtPos.spec) === null || _decAtPos$spec2 === void 0 ? void 0 : _decAtPos$spec2.nodeType) !== null && _ref7 !== void 0 ? _ref7 : activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType, nodeViewPortalProviderAPI, meta === null || meta === void 0 || (_meta$activeNode6 = meta.activeNode) === null || _meta$activeNode6 === void 0 ? void 0 : _meta$activeNode6.handleOptions);
|
|
332
332
|
} else {
|
|
333
333
|
var nodeType = activeNode.nodeType;
|
|
334
334
|
var anchorName = activeNode.anchorName;
|
|
@@ -341,7 +341,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
341
341
|
anchorName: anchorName
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
draghandleDec = dragHandleDecoration(api, formatMessage, activeNode.pos, anchorName, nodeType);
|
|
344
|
+
draghandleDec = dragHandleDecoration(api, formatMessage, activeNode.pos, anchorName, nodeType, nodeViewPortalProviderAPI);
|
|
345
345
|
}
|
|
346
346
|
decorations = decorations.add(newState.doc, [draghandleDec]);
|
|
347
347
|
}
|
|
@@ -353,7 +353,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
353
353
|
return spec.type === 'drag-handle';
|
|
354
354
|
});
|
|
355
355
|
decorations = decorations.remove(_oldHandle3);
|
|
356
|
-
var decs = dragHandleDecoration(api, formatMessage, meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, meta.activeNode.handleOptions);
|
|
356
|
+
var decs = dragHandleDecoration(api, formatMessage, meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, nodeViewPortalProviderAPI, meta.activeNode.handleOptions);
|
|
357
357
|
decorations = decorations.add(newState.doc, [decs]);
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -363,10 +363,10 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
363
363
|
return spec.type === 'drag-handle';
|
|
364
364
|
});
|
|
365
365
|
decorations = decorations.remove(_oldHandle4);
|
|
366
|
-
var _decs = dragHandleDecoration(api, formatMessage, activeNodeWithNewNodeType.pos, activeNodeWithNewNodeType.anchorName, activeNodeWithNewNodeType.nodeType);
|
|
366
|
+
var _decs = dragHandleDecoration(api, formatMessage, activeNodeWithNewNodeType.pos, activeNodeWithNewNodeType.anchorName, activeNodeWithNewNodeType.nodeType, nodeViewPortalProviderAPI);
|
|
367
367
|
decorations = decorations.add(newState.doc, [_decs]);
|
|
368
368
|
}
|
|
369
|
-
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing) {
|
|
369
|
+
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false || isDropTargetsMissing || isBlocksDragTargetDebug()) {
|
|
370
370
|
// Remove drop target decoration when dragging stops
|
|
371
371
|
var dropTargetDecs = decorations.find(undefined, undefined, function (spec) {
|
|
372
372
|
return spec.type === 'drop-target-decoration';
|
|
@@ -386,7 +386,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
386
386
|
// if the transaction is only for analytics and user is dragging, continue to draw drop targets
|
|
387
387
|
if (shouldCreateDropTargets || isBlocksDragTargetDebug()) {
|
|
388
388
|
var _meta$activeNode7;
|
|
389
|
-
var _decs2 = dropTargetDecorations(newState, api, formatMessage, isNestedEnabled ? (_meta$activeNode7 = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode7 !== void 0 ? _meta$activeNode7 : mappedActiveNodePos : meta === null || meta === void 0 ? void 0 : meta.activeNode, anchorRectCache);
|
|
389
|
+
var _decs2 = dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, isNestedEnabled ? (_meta$activeNode7 = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode7 !== void 0 ? _meta$activeNode7 : mappedActiveNodePos : meta === null || meta === void 0 ? void 0 : meta.activeNode, anchorRectCache);
|
|
390
390
|
decorations = decorations.add(newState.doc, _decs2);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
@@ -415,7 +415,7 @@ export var oldApply = function oldApply(api, formatMessage, tr, currentState, ol
|
|
|
415
415
|
isPMDragging: (_meta$isPMDragging2 = meta === null || meta === void 0 ? void 0 : meta.isPMDragging) !== null && _meta$isPMDragging2 !== void 0 ? _meta$isPMDragging2 : isPMDragging
|
|
416
416
|
};
|
|
417
417
|
};
|
|
418
|
-
export var createPlugin = function createPlugin(api, getIntl) {
|
|
418
|
+
export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProviderAPI) {
|
|
419
419
|
var _getIntl = getIntl(),
|
|
420
420
|
formatMessage = _getIntl.formatMessage;
|
|
421
421
|
var isNestedEnabled = editorExperiment('nested-dnd', true, {
|
|
@@ -443,9 +443,9 @@ export var createPlugin = function createPlugin(api, getIntl) {
|
|
|
443
443
|
},
|
|
444
444
|
apply: function apply(tr, currentState, oldState, newState) {
|
|
445
445
|
if (isOptimisedApply) {
|
|
446
|
-
return newApply(api, formatMessage, tr, currentState, newState, flags, anchorRectCache);
|
|
446
|
+
return newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache);
|
|
447
447
|
}
|
|
448
|
-
return oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, anchorRectCache);
|
|
448
|
+
return oldApply(api, formatMessage, tr, currentState, oldState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache);
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
451
|
props: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
export declare const TYPE_DROP_TARGET_DEC = "drop-target-decoration";
|
|
3
4
|
export declare const TYPE_HANDLE_DEC = "drag-handle";
|
|
4
5
|
export declare const TYPE_NODE_DEC = "node-decoration";
|
|
5
6
|
export declare const getNestedDepth: () => 0 | 100;
|
|
6
7
|
export declare const getNodeAnchor: (node: PMNode) => string;
|
|
7
|
-
export declare const unmountDecorations: (selector: string) => void;
|
|
8
|
+
export declare const unmountDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, selector: string, key: string) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
4
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { BlockControlsPlugin, HandleOptions } from '../types';
|
|
5
6
|
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
6
7
|
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
7
|
-
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, handleOptions?: HandleOptions) => Decoration;
|
|
8
|
+
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, nodeViewPortalProviderAPI: PortalProviderAPI, handleOptions?: HandleOptions) => Decoration;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -14,6 +15,6 @@ import { type AnchorRectCache } from '../utils/anchor-utils';
|
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
17
|
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
17
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, 'getPos'>, side?: number, anchorRectCache?: AnchorRectCache, isSameLayout?: boolean) => Decoration;
|
|
18
|
-
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps, 'getPos'>, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
19
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
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[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -11,7 +12,7 @@ export interface FlagType {
|
|
|
11
12
|
isNestedEnabled: boolean;
|
|
12
13
|
isOptimisedApply: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, anchorRectCache?: AnchorRectCache) => {
|
|
15
|
+
export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
15
16
|
decorations: DecorationSet;
|
|
16
17
|
activeNode: any;
|
|
17
18
|
isDragging: any;
|
|
@@ -23,7 +24,7 @@ export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> |
|
|
|
23
24
|
isDocSizeLimitEnabled: boolean | null;
|
|
24
25
|
isPMDragging: any;
|
|
25
26
|
};
|
|
26
|
-
export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, oldState: EditorState, newState: EditorState, flags: FlagType, anchorRectCache?: AnchorRectCache) => {
|
|
27
|
+
export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, oldState: EditorState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
27
28
|
decorations: DecorationSet;
|
|
28
29
|
activeNode: any;
|
|
29
30
|
isDragging: any;
|
|
@@ -35,4 +36,4 @@ export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> |
|
|
|
35
36
|
isDocSizeLimitEnabled: boolean | null;
|
|
36
37
|
isPMDragging: any;
|
|
37
38
|
};
|
|
38
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape) => SafePlugin<PluginState>;
|
|
39
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
1
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
export declare const TYPE_DROP_TARGET_DEC = "drop-target-decoration";
|
|
3
4
|
export declare const TYPE_HANDLE_DEC = "drag-handle";
|
|
4
5
|
export declare const TYPE_NODE_DEC = "node-decoration";
|
|
5
6
|
export declare const getNestedDepth: () => 0 | 100;
|
|
6
7
|
export declare const getNodeAnchor: (node: PMNode) => string;
|
|
7
|
-
export declare const unmountDecorations: (selector: string) => void;
|
|
8
|
+
export declare const unmountDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, selector: string, key: string) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
4
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { BlockControlsPlugin, HandleOptions } from '../types';
|
|
5
6
|
export declare const emptyParagraphNodeDecorations: () => Decoration;
|
|
6
7
|
export declare const findHandleDec: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
7
|
-
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, handleOptions?: HandleOptions) => Decoration;
|
|
8
|
+
export declare const dragHandleDecoration: (api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], pos: number, anchorName: string, nodeType: string, nodeViewPortalProviderAPI: PortalProviderAPI, handleOptions?: HandleOptions) => Decoration;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import { Decoration, type DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -14,6 +15,6 @@ import { type AnchorRectCache } from '../utils/anchor-utils';
|
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
17
|
export declare const findDropTargetDecs: (decorations: DecorationSet, from?: number, to?: number) => Decoration[];
|
|
17
|
-
export declare const createDropTargetDecoration: (pos: number, props: Omit<DropTargetProps, 'getPos'>, side?: number, anchorRectCache?: AnchorRectCache, isSameLayout?: boolean) => Decoration;
|
|
18
|
-
export declare const createLayoutDropTargetDecoration: (pos: number, props: Omit<DropTargetLayoutProps, 'getPos'>, anchorRectCache?: AnchorRectCache) => Decoration;
|
|
19
|
-
export declare const dropTargetDecorations: (newState: EditorState, api: ExtractInjectionAPI<BlockControlsPlugin>, formatMessage: IntlShape['formatMessage'], activeNode?: ActiveNode, anchorRectCache?: AnchorRectCache, from?: number, to?: number) => Decoration[];
|
|
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[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -11,7 +12,7 @@ export interface FlagType {
|
|
|
11
12
|
isNestedEnabled: boolean;
|
|
12
13
|
isOptimisedApply: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, anchorRectCache?: AnchorRectCache) => {
|
|
15
|
+
export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
15
16
|
decorations: DecorationSet;
|
|
16
17
|
activeNode: any;
|
|
17
18
|
isDragging: any;
|
|
@@ -23,7 +24,7 @@ export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> |
|
|
|
23
24
|
isDocSizeLimitEnabled: boolean | null;
|
|
24
25
|
isPMDragging: any;
|
|
25
26
|
};
|
|
26
|
-
export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, oldState: EditorState, newState: EditorState, flags: FlagType, anchorRectCache?: AnchorRectCache) => {
|
|
27
|
+
export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, oldState: EditorState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
27
28
|
decorations: DecorationSet;
|
|
28
29
|
activeNode: any;
|
|
29
30
|
isDragging: any;
|
|
@@ -35,4 +36,4 @@ export declare const oldApply: (api: ExtractInjectionAPI<BlockControlsPlugin> |
|
|
|
35
36
|
isDocSizeLimitEnabled: boolean | null;
|
|
36
37
|
isPMDragging: any;
|
|
37
38
|
};
|
|
38
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape) => SafePlugin<PluginState>;
|
|
39
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<PluginState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.23",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/adf-schema": "^44.2.0",
|
|
34
|
-
"@atlaskit/editor-common": "^95.
|
|
34
|
+
"@atlaskit/editor-common": "^95.4.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -162,6 +162,9 @@
|
|
|
162
162
|
},
|
|
163
163
|
"platform_editor_advanced_layouts_breakout_resizing": {
|
|
164
164
|
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"platform_editor_react18_plugin_portalprovider": {
|
|
167
|
+
"type": "boolean"
|
|
165
168
|
}
|
|
166
169
|
}
|
|
167
170
|
}
|