@atlaskit/editor-plugin-block-controls 2.26.1 → 2.26.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.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/editor-commands/move-node.js +16 -15
- package/dist/cjs/editor-commands/move-to-layout.js +20 -8
- package/dist/cjs/editor-commands/show-drag-handle.js +89 -3
- package/dist/cjs/pm-plugins/decorations-anchor.js +5 -10
- package/dist/cjs/pm-plugins/decorations-common.js +5 -1
- package/dist/cjs/pm-plugins/main.js +28 -8
- package/dist/cjs/pm-plugins/utils/analytics.js +66 -0
- package/dist/cjs/pm-plugins/utils/selection.js +22 -2
- package/dist/cjs/ui/drag-handle.js +23 -9
- package/dist/es2019/editor-commands/move-node.js +17 -16
- package/dist/es2019/editor-commands/move-to-layout.js +20 -8
- package/dist/es2019/editor-commands/show-drag-handle.js +88 -3
- package/dist/es2019/pm-plugins/decorations-anchor.js +6 -11
- package/dist/es2019/pm-plugins/decorations-common.js +4 -0
- package/dist/es2019/pm-plugins/main.js +24 -6
- package/dist/es2019/pm-plugins/utils/{fire-analytics.js → analytics.js} +31 -3
- package/dist/es2019/pm-plugins/utils/selection.js +22 -1
- package/dist/es2019/ui/drag-handle.js +19 -3
- package/dist/esm/editor-commands/move-node.js +17 -16
- package/dist/esm/editor-commands/move-to-layout.js +20 -8
- package/dist/esm/editor-commands/show-drag-handle.js +88 -2
- package/dist/esm/pm-plugins/decorations-anchor.js +6 -11
- package/dist/esm/pm-plugins/decorations-common.js +4 -0
- package/dist/esm/pm-plugins/main.js +27 -7
- package/dist/esm/pm-plugins/utils/{fire-analytics.js → analytics.js} +32 -3
- package/dist/esm/pm-plugins/utils/selection.js +21 -1
- package/dist/esm/ui/drag-handle.js +22 -4
- package/dist/types/editor-commands/show-drag-handle.d.ts +1 -1
- package/dist/types/pm-plugins/decorations-common.d.ts +1 -0
- package/dist/types/pm-plugins/main.d.ts +1 -0
- package/dist/types/pm-plugins/utils/analytics.d.ts +12 -0
- package/dist/types/pm-plugins/utils/selection.d.ts +9 -0
- package/dist/types-ts4.5/editor-commands/show-drag-handle.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/decorations-common.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +12 -0
- package/dist/types-ts4.5/pm-plugins/utils/selection.d.ts +9 -0
- package/package.json +10 -4
- package/dist/cjs/pm-plugins/utils/fire-analytics.js +0 -36
- package/dist/types/pm-plugins/utils/fire-analytics.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/utils/fire-analytics.d.ts +0 -5
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
3
4
|
export declare const getMultiSelectionIfPosInside: (api: ExtractInjectionAPI<BlockControlsPlugin>, pos: number) => {
|
|
4
5
|
anchor?: number;
|
|
5
6
|
head?: number;
|
|
6
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @returns from and to positions of the selected content (after expansion)
|
|
11
|
+
*/
|
|
12
|
+
export declare const getSelectedSlicePosition: (handlePos: number, tr: Transaction, api: ExtractInjectionAPI<BlockControlsPlugin>) => {
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { BlockControlsPlugin } from '../blockControlsPluginType';
|
|
3
|
-
export declare const showDragHandleAtSelection: (api?: ExtractInjectionAPI<BlockControlsPlugin
|
|
3
|
+
export declare const showDragHandleAtSelection: (api?: ExtractInjectionAPI<BlockControlsPlugin>) => Command;
|
|
@@ -5,4 +5,5 @@ export declare const TYPE_HANDLE_DEC = "drag-handle";
|
|
|
5
5
|
export declare const TYPE_NODE_DEC = "node-decoration";
|
|
6
6
|
export declare const getNestedDepth: () => 0 | 100;
|
|
7
7
|
export declare const getNodeAnchor: (node: PMNode) => string;
|
|
8
|
+
export declare const getNodeTypeWithLevel: (node: PMNode) => string;
|
|
8
9
|
export declare const unmountDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, selector: string, key: string) => void;
|
|
@@ -12,6 +12,7 @@ export interface FlagType {
|
|
|
12
12
|
isNestedEnabled: boolean;
|
|
13
13
|
isMultiSelectEnabled: boolean;
|
|
14
14
|
}
|
|
15
|
+
export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
|
|
15
16
|
export declare const newApply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, anchorRectCache?: AnchorRectCache) => {
|
|
16
17
|
decorations: DecorationSet;
|
|
17
18
|
activeNode: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
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, fromNodeType: string, toDepth?: number, toNodeType?: string, isSameParent?: boolean, api?: ExtractInjectionAPI<BlockControlsPlugin>, fromNodeTypes?: string, hasSelectedMultipleNodes?: boolean) => boolean | undefined;
|
|
5
|
+
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>, nodeTypes?: string, hasSelectedMultipleNodes?: boolean) => 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
|
+
nodeTypes: string | undefined;
|
|
11
|
+
hasSelectedMultipleNodes: boolean;
|
|
12
|
+
};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
3
4
|
export declare const getMultiSelectionIfPosInside: (api: ExtractInjectionAPI<BlockControlsPlugin>, pos: number) => {
|
|
4
5
|
anchor?: number;
|
|
5
6
|
head?: number;
|
|
6
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @returns from and to positions of the selected content (after expansion)
|
|
11
|
+
*/
|
|
12
|
+
export declare const getSelectedSlicePosition: (handlePos: number, tr: Transaction, api: ExtractInjectionAPI<BlockControlsPlugin>) => {
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "2.26.
|
|
3
|
+
"version": "2.26.2",
|
|
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": "^46.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^99.
|
|
34
|
+
"@atlaskit/editor-common": "^99.14.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.4.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.12.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.5.0",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
44
44
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
45
|
-
"@atlaskit/icon": "^23.
|
|
45
|
+
"@atlaskit/icon": "^23.9.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.2.0",
|
|
50
50
|
"@atlaskit/primitives": "^13.5.0",
|
|
51
51
|
"@atlaskit/theme": "^15.0.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^2.46.0",
|
|
53
53
|
"@atlaskit/tokens": "^3.3.0",
|
|
54
54
|
"@atlaskit/tooltip": "^19.1.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
@@ -142,6 +142,12 @@
|
|
|
142
142
|
},
|
|
143
143
|
"platform_editor_advanced_layouts_accessibility": {
|
|
144
144
|
"type": "boolean"
|
|
145
|
+
},
|
|
146
|
+
"platform_editor_advanced_layouts_a11y": {
|
|
147
|
+
"type": "boolean"
|
|
148
|
+
},
|
|
149
|
+
"platform_editor_track_node_types": {
|
|
150
|
+
"type": "boolean"
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
153
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.fireInsertLayoutAnalytics = exports.attachMoveNodeAnalytics = void 0;
|
|
7
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
-
var attachMoveNodeAnalytics = exports.attachMoveNodeAnalytics = function attachMoveNodeAnalytics(tr, inputMethod, fromDepth, fromNodeType, toDepth, toNodeType, isSameParent, api) {
|
|
9
|
-
var _api$analytics;
|
|
10
|
-
return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.attachAnalyticsEvent({
|
|
11
|
-
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
12
|
-
action: _analytics.ACTION.MOVED,
|
|
13
|
-
actionSubject: _analytics.ACTION_SUBJECT.ELEMENT,
|
|
14
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.ELEMENT_DRAG_HANDLE,
|
|
15
|
-
attributes: {
|
|
16
|
-
nodeDepth: fromDepth,
|
|
17
|
-
nodeType: fromNodeType,
|
|
18
|
-
destinationNodeDepth: toDepth,
|
|
19
|
-
destinationNodeType: toNodeType,
|
|
20
|
-
isSameParent: isSameParent,
|
|
21
|
-
inputMethod: inputMethod
|
|
22
|
-
}
|
|
23
|
-
})(tr);
|
|
24
|
-
};
|
|
25
|
-
var fireInsertLayoutAnalytics = exports.fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, api) {
|
|
26
|
-
var _api$analytics2;
|
|
27
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.actions) === null || _api$analytics2 === void 0 || _api$analytics2.attachAnalyticsEvent({
|
|
28
|
-
action: _analytics.ACTION.INSERTED,
|
|
29
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
30
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.LAYOUT,
|
|
31
|
-
attributes: {
|
|
32
|
-
inputMethod: _analytics.INPUT_METHOD.DRAG_AND_DROP
|
|
33
|
-
},
|
|
34
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
35
|
-
})(tr);
|
|
36
|
-
};
|
|
@@ -1,5 +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, fromNodeType: string, toDepth?: number, toNodeType?: string, isSameParent?: boolean, api?: ExtractInjectionAPI<BlockControlsPlugin>) => boolean | undefined;
|
|
5
|
-
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>) => void;
|
|
@@ -1,5 +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, fromNodeType: string, toDepth?: number, toNodeType?: string, isSameParent?: boolean, api?: ExtractInjectionAPI<BlockControlsPlugin>) => boolean | undefined;
|
|
5
|
-
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>) => void;
|