@atlaskit/editor-plugin-block-controls 3.12.0 → 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 CHANGED
@@ -1,5 +1,17 @@
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
+
3
15
  ## 3.12.0
4
16
 
5
17
  ### 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, _analytics2.fireInsertLayoutAnalytics)(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
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
  }
@@ -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
- fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
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
  }
@@ -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
- fireInsertLayoutAnalytics(tr, api, sourceNodeTypes, hasSelectedMultipleNodes);
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
  }
@@ -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.12.0",
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.19.0",
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",
@@ -184,6 +184,9 @@
184
184
  "platform_editor_no_selection_until_interaction": {
185
185
  "type": "boolean"
186
186
  },
187
+ "platform_editor_column_count_analytics": {
188
+ "type": "boolean"
189
+ },
187
190
  "platform_editor_fix_widget_destroy": {
188
191
  "type": "boolean"
189
192
  }