@atlaskit/editor-plugin-block-controls 3.11.2 → 3.13.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 +24 -0
- package/dist/cjs/editor-commands/move-to-layout.js +6 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/pm-plugins/utils/analytics.js +3 -2
- package/dist/es2019/editor-commands/move-to-layout.js +6 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/utils/analytics.js +3 -2
- package/dist/esm/editor-commands/move-to-layout.js +6 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/utils/analytics.js +3 -2
- package/dist/types/pm-plugins/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#146198](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146198)
|
|
8
|
+
[`86a786e83342d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/86a786e83342d) -
|
|
9
|
+
ED-27730 update layout analytics to include layout column count
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 3.12.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#141039](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141039)
|
|
20
|
+
[`ac95ffeb54bda`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac95ffeb54bda) -
|
|
21
|
+
ED-27226 clean up platform_editor_advanced_layouts_redraw_on_drag
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 3.11.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -330,7 +330,12 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
330
330
|
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
331
331
|
mode: breakoutMode
|
|
332
332
|
})]);
|
|
333
|
-
(0,
|
|
333
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_column_count_analytics')) {
|
|
334
|
+
// layout created via drag and drop will always be 2 columns
|
|
335
|
+
(0, _analytics2.fireInsertLayoutAnalytics)(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
336
|
+
} else {
|
|
337
|
+
(0, _analytics2.fireInsertLayoutAnalytics)(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
338
|
+
}
|
|
334
339
|
}
|
|
335
340
|
return tr;
|
|
336
341
|
}
|
|
@@ -281,7 +281,7 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
|
|
|
281
281
|
// Re-create node decorations
|
|
282
282
|
var isDecSetEmpty = decorations === _view2.DecorationSet.empty;
|
|
283
283
|
var isNodeDecsMissing = isDecSetEmpty || maybeNodeCountChanged;
|
|
284
|
-
var shouldRedrawNodeDecs = !isResizerResizing && (
|
|
284
|
+
var shouldRedrawNodeDecs = !isResizerResizing && (isNodeDecsMissing || (meta === null || meta === void 0 ? void 0 : meta.isDragging));
|
|
285
285
|
var isActiveNodeModified = false;
|
|
286
286
|
if (api && shouldRedrawNodeDecs) {
|
|
287
287
|
var oldNodeDecs = (0, _decorationsAnchor.findNodeDecs)(decorations, from, to);
|
|
@@ -27,7 +27,7 @@ var attachMoveNodeAnalytics = exports.attachMoveNodeAnalytics = function attachM
|
|
|
27
27
|
}
|
|
28
28
|
})(tr);
|
|
29
29
|
};
|
|
30
|
-
var fireInsertLayoutAnalytics = exports.fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, api, nodeTypes, hasSelectedMultipleNodes) {
|
|
30
|
+
var fireInsertLayoutAnalytics = exports.fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, api, nodeTypes, hasSelectedMultipleNodes, columnCount) {
|
|
31
31
|
var _api$analytics2;
|
|
32
32
|
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({
|
|
33
33
|
action: _analytics.ACTION.INSERTED,
|
|
@@ -36,7 +36,8 @@ var fireInsertLayoutAnalytics = exports.fireInsertLayoutAnalytics = function fir
|
|
|
36
36
|
attributes: {
|
|
37
37
|
inputMethod: _analytics.INPUT_METHOD.DRAG_AND_DROP,
|
|
38
38
|
nodeTypes: nodeTypes,
|
|
39
|
-
hasSelectedMultipleNodes: hasSelectedMultipleNodes
|
|
39
|
+
hasSelectedMultipleNodes: hasSelectedMultipleNodes,
|
|
40
|
+
columnCount: columnCount
|
|
40
41
|
},
|
|
41
42
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
42
43
|
})(tr);
|
|
@@ -320,7 +320,12 @@ export const moveToLayout = api => (from, to, options) => ({
|
|
|
320
320
|
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
321
321
|
mode: breakoutMode
|
|
322
322
|
})]);
|
|
323
|
-
|
|
323
|
+
if (fg('platform_editor_column_count_analytics')) {
|
|
324
|
+
// layout created via drag and drop will always be 2 columns
|
|
325
|
+
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
326
|
+
} else {
|
|
327
|
+
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
328
|
+
}
|
|
324
329
|
}
|
|
325
330
|
return tr;
|
|
326
331
|
}
|
|
@@ -281,7 +281,7 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
|
|
|
281
281
|
// Re-create node decorations
|
|
282
282
|
const isDecSetEmpty = decorations === DecorationSet.empty;
|
|
283
283
|
const isNodeDecsMissing = isDecSetEmpty || maybeNodeCountChanged;
|
|
284
|
-
const shouldRedrawNodeDecs = !isResizerResizing && (
|
|
284
|
+
const shouldRedrawNodeDecs = !isResizerResizing && (isNodeDecsMissing || (meta === null || meta === void 0 ? void 0 : meta.isDragging));
|
|
285
285
|
let isActiveNodeModified = false;
|
|
286
286
|
if (api && shouldRedrawNodeDecs) {
|
|
287
287
|
const oldNodeDecs = findNodeDecs(decorations, from, to);
|
|
@@ -19,7 +19,7 @@ export const attachMoveNodeAnalytics = (tr, inputMethod, fromDepth, fromNodeType
|
|
|
19
19
|
}
|
|
20
20
|
})(tr);
|
|
21
21
|
};
|
|
22
|
-
export const fireInsertLayoutAnalytics = (tr, api, nodeTypes, hasSelectedMultipleNodes) => {
|
|
22
|
+
export const fireInsertLayoutAnalytics = (tr, api, nodeTypes, hasSelectedMultipleNodes, columnCount) => {
|
|
23
23
|
var _api$analytics2, _api$analytics2$actio;
|
|
24
24
|
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : (_api$analytics2$actio = _api$analytics2.actions) === null || _api$analytics2$actio === void 0 ? void 0 : _api$analytics2$actio.attachAnalyticsEvent({
|
|
25
25
|
action: ACTION.INSERTED,
|
|
@@ -28,7 +28,8 @@ export const fireInsertLayoutAnalytics = (tr, api, nodeTypes, hasSelectedMultipl
|
|
|
28
28
|
attributes: {
|
|
29
29
|
inputMethod: INPUT_METHOD.DRAG_AND_DROP,
|
|
30
30
|
nodeTypes,
|
|
31
|
-
hasSelectedMultipleNodes
|
|
31
|
+
hasSelectedMultipleNodes,
|
|
32
|
+
columnCount
|
|
32
33
|
},
|
|
33
34
|
eventType: EVENT_TYPE.TRACK
|
|
34
35
|
})(tr);
|
|
@@ -324,7 +324,12 @@ export var moveToLayout = function moveToLayout(api) {
|
|
|
324
324
|
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
325
325
|
mode: breakoutMode
|
|
326
326
|
})]);
|
|
327
|
-
|
|
327
|
+
if (fg('platform_editor_column_count_analytics')) {
|
|
328
|
+
// layout created via drag and drop will always be 2 columns
|
|
329
|
+
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes, 2);
|
|
330
|
+
} else {
|
|
331
|
+
fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
332
|
+
}
|
|
328
333
|
}
|
|
329
334
|
return tr;
|
|
330
335
|
}
|
|
@@ -274,7 +274,7 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
|
|
|
274
274
|
// Re-create node decorations
|
|
275
275
|
var isDecSetEmpty = decorations === DecorationSet.empty;
|
|
276
276
|
var isNodeDecsMissing = isDecSetEmpty || maybeNodeCountChanged;
|
|
277
|
-
var shouldRedrawNodeDecs = !isResizerResizing && (
|
|
277
|
+
var shouldRedrawNodeDecs = !isResizerResizing && (isNodeDecsMissing || (meta === null || meta === void 0 ? void 0 : meta.isDragging));
|
|
278
278
|
var isActiveNodeModified = false;
|
|
279
279
|
if (api && shouldRedrawNodeDecs) {
|
|
280
280
|
var oldNodeDecs = findNodeDecs(decorations, from, to);
|
|
@@ -20,7 +20,7 @@ export var attachMoveNodeAnalytics = function attachMoveNodeAnalytics(tr, inputM
|
|
|
20
20
|
}
|
|
21
21
|
})(tr);
|
|
22
22
|
};
|
|
23
|
-
export var fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, api, nodeTypes, hasSelectedMultipleNodes) {
|
|
23
|
+
export var fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, api, nodeTypes, hasSelectedMultipleNodes, columnCount) {
|
|
24
24
|
var _api$analytics2;
|
|
25
25
|
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({
|
|
26
26
|
action: ACTION.INSERTED,
|
|
@@ -29,7 +29,8 @@ export var fireInsertLayoutAnalytics = function fireInsertLayoutAnalytics(tr, ap
|
|
|
29
29
|
attributes: {
|
|
30
30
|
inputMethod: INPUT_METHOD.DRAG_AND_DROP,
|
|
31
31
|
nodeTypes: nodeTypes,
|
|
32
|
-
hasSelectedMultipleNodes: hasSelectedMultipleNodes
|
|
32
|
+
hasSelectedMultipleNodes: hasSelectedMultipleNodes,
|
|
33
|
+
columnCount: columnCount
|
|
33
34
|
},
|
|
34
35
|
eventType: EVENT_TYPE.TRACK
|
|
35
36
|
})(tr);
|
|
@@ -2,7 +2,7 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { type BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
4
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;
|
|
5
|
+
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>, nodeTypes?: string, hasSelectedMultipleNodes?: boolean, columnCount?: number) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Given a range, return distinctive types of node and whether there are multiple nodes in the range
|
|
8
8
|
*/
|
|
@@ -2,7 +2,7 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import { type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { type BlockControlsPlugin } from '../../blockControlsPluginType';
|
|
4
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;
|
|
5
|
+
export declare const fireInsertLayoutAnalytics: (tr: Transaction, api?: ExtractInjectionAPI<BlockControlsPlugin>, nodeTypes?: string, hasSelectedMultipleNodes?: boolean, columnCount?: number) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Given a range, return distinctive types of node and whether there are multiple nodes in the range
|
|
8
8
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^103.
|
|
36
|
+
"@atlaskit/editor-common": "^103.20.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
51
51
|
"@atlaskit/icon": "^25.6.0",
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
|
-
"@atlaskit/pragmatic-drag-and-drop": "^1.
|
|
53
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
55
55
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
|
|
56
56
|
"@atlaskit/primitives": "^14.4.0",
|
|
57
57
|
"@atlaskit/theme": "^18.0.0",
|
|
58
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
58
|
+
"@atlaskit/tmp-editor-statsig": "^4.15.0",
|
|
59
59
|
"@atlaskit/tokens": "^4.8.0",
|
|
60
60
|
"@atlaskit/tooltip": "^20.0.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -115,9 +115,6 @@
|
|
|
115
115
|
"platform_editor_element_dnd_nested_fix_patch_6": {
|
|
116
116
|
"type": "boolean"
|
|
117
117
|
},
|
|
118
|
-
"platform_editor_advanced_layouts_redraw_on_drag": {
|
|
119
|
-
"type": "boolean"
|
|
120
|
-
},
|
|
121
118
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
122
119
|
"type": "boolean"
|
|
123
120
|
},
|
|
@@ -187,6 +184,9 @@
|
|
|
187
184
|
"platform_editor_no_selection_until_interaction": {
|
|
188
185
|
"type": "boolean"
|
|
189
186
|
},
|
|
187
|
+
"platform_editor_column_count_analytics": {
|
|
188
|
+
"type": "boolean"
|
|
189
|
+
},
|
|
190
190
|
"platform_editor_fix_widget_destroy": {
|
|
191
191
|
"type": "boolean"
|
|
192
192
|
}
|