@atlaskit/editor-plugin-block-controls 3.12.0 → 3.13.1
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 +21 -0
- package/dist/cjs/editor-commands/move-to-layout.js +6 -1
- package/dist/cjs/pm-plugins/decorations-anchor.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/decorations-anchor.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/decorations-anchor.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 +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#148485](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148485)
|
|
8
|
+
[`a3ec09f649d4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3ec09f649d4a) -
|
|
9
|
+
[EDITOR-323] Clean up feature gate `platform_editor_disable_drag_handle_nested_tables`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.13.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#146198](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146198)
|
|
17
|
+
[`86a786e83342d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/86a786e83342d) -
|
|
18
|
+
ED-27730 update layout analytics to include layout column count
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 3.12.0
|
|
4
25
|
|
|
5
26
|
### Minor 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
|
}
|
|
@@ -35,7 +35,7 @@ var shouldIgnoreNode = function shouldIgnoreNode(node, ignore_nodes, depth, pare
|
|
|
35
35
|
var isTable = node.type.name === (nodeTypes === null || nodeTypes === void 0 || (_nodeTypes$table = nodeTypes.table) === null || _nodeTypes$table === void 0 ? void 0 : _nodeTypes$table.name);
|
|
36
36
|
var parentIsTable = parent && [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
37
37
|
var isNestedTable = isTable && parentIsTable;
|
|
38
|
-
if (isNestedTable
|
|
38
|
+
if (isNestedTable) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
41
|
var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && (0, _experiments.editorExperiment)('advanced_layouts', true);
|
|
@@ -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
|
}
|
|
@@ -27,7 +27,7 @@ const shouldIgnoreNode = (node, ignore_nodes, depth, parent) => {
|
|
|
27
27
|
const isTable = node.type.name === (nodeTypes === null || nodeTypes === void 0 ? void 0 : (_nodeTypes$table = nodeTypes.table) === null || _nodeTypes$table === void 0 ? void 0 : _nodeTypes$table.name);
|
|
28
28
|
const parentIsTable = parent && [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
29
29
|
const isNestedTable = isTable && parentIsTable;
|
|
30
|
-
if (isNestedTable
|
|
30
|
+
if (isNestedTable) {
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
33
|
const isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && editorExperiment('advanced_layouts', true);
|
|
@@ -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
|
}
|
|
@@ -28,7 +28,7 @@ var shouldIgnoreNode = function shouldIgnoreNode(node, ignore_nodes, depth, pare
|
|
|
28
28
|
var isTable = node.type.name === (nodeTypes === null || nodeTypes === void 0 || (_nodeTypes$table = nodeTypes.table) === null || _nodeTypes$table === void 0 ? void 0 : _nodeTypes$table.name);
|
|
29
29
|
var parentIsTable = parent && [nodeTypes.tableHeader, nodeTypes.tableCell].includes(parent.type);
|
|
30
30
|
var isNestedTable = isTable && parentIsTable;
|
|
31
|
-
if (isNestedTable
|
|
31
|
+
if (isNestedTable) {
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
34
|
var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && editorExperiment('advanced_layouts', true);
|
|
@@ -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.1",
|
|
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.22.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",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-interaction": "^1.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
43
43
|
"@atlaskit/editor-plugin-quick-insert": "^2.4.0",
|
|
44
|
-
"@atlaskit/editor-plugin-selection": "^2.
|
|
45
|
-
"@atlaskit/editor-plugin-type-ahead": "^2.
|
|
44
|
+
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
45
|
+
"@atlaskit/editor-plugin-type-ahead": "^2.6.0",
|
|
46
46
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
47
47
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
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
|
-
"@atlaskit/primitives": "^14.
|
|
56
|
+
"@atlaskit/primitives": "^14.6.0",
|
|
57
57
|
"@atlaskit/theme": "^18.0.0",
|
|
58
58
|
"@atlaskit/tmp-editor-statsig": "^4.15.0",
|
|
59
59
|
"@atlaskit/tokens": "^4.8.0",
|
|
@@ -127,9 +127,6 @@
|
|
|
127
127
|
"platform_editor_track_node_types": {
|
|
128
128
|
"type": "boolean"
|
|
129
129
|
},
|
|
130
|
-
"platform_editor_disable_drag_handle_nested_tables": {
|
|
131
|
-
"type": "boolean"
|
|
132
|
-
},
|
|
133
130
|
"platform_editor_elements_dnd_shift_click_select": {
|
|
134
131
|
"type": "boolean"
|
|
135
132
|
},
|
|
@@ -184,6 +181,9 @@
|
|
|
184
181
|
"platform_editor_no_selection_until_interaction": {
|
|
185
182
|
"type": "boolean"
|
|
186
183
|
},
|
|
184
|
+
"platform_editor_column_count_analytics": {
|
|
185
|
+
"type": "boolean"
|
|
186
|
+
},
|
|
187
187
|
"platform_editor_fix_widget_destroy": {
|
|
188
188
|
"type": "boolean"
|
|
189
189
|
}
|