@atlaskit/editor-plugin-table 6.1.0 → 7.0.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-table
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#67703](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67703) [`d5303cb0f0cb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d5303cb0f0cb) - When a table is inserted via the table selector popup, an analytics event should be sent with the totalRowCount and totalColumnCount and the input method picker. Removed ASCII and TYPEAHEAD inputMethod from table selector command.
8
+
9
+ ## 6.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 6.1.0
4
16
 
5
17
  ### Minor Changes
@@ -166,6 +166,19 @@ var insertTableWithSize = exports.insertTableWithSize = function insertTableWith
166
166
  colsCount: colsCount
167
167
  });
168
168
  var newTr = (0, _utils.safeInsert)(tableNode)(tr).scrollIntoView();
169
+ if (inputMethod) {
170
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
171
+ action: _analytics.ACTION.INSERTED,
172
+ actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
173
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
174
+ attributes: {
175
+ inputMethod: inputMethod,
176
+ totalRowCount: rowsCount,
177
+ totalColumnCount: colsCount
178
+ },
179
+ eventType: _analytics.EVENT_TYPE.TRACK
180
+ })(newTr);
181
+ }
169
182
  return newTr;
170
183
  };
171
184
  };
@@ -1,6 +1,6 @@
1
1
  // #region Imports
2
2
  import { AddColumnStep } from '@atlaskit/custom-steps';
3
- import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
3
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
4
4
  import { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { TableMap } from '@atlaskit/editor-tables/table-map';
@@ -145,6 +145,19 @@ export const insertTableWithSize = editorAnalyticsAPI => (rowsCount, colsCount,
145
145
  colsCount: colsCount
146
146
  });
147
147
  const newTr = safeInsert(tableNode)(tr).scrollIntoView();
148
+ if (inputMethod) {
149
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
150
+ action: ACTION.INSERTED,
151
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
152
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
153
+ attributes: {
154
+ inputMethod: inputMethod,
155
+ totalRowCount: rowsCount,
156
+ totalColumnCount: colsCount
157
+ },
158
+ eventType: EVENT_TYPE.TRACK
159
+ })(newTr);
160
+ }
148
161
  return newTr;
149
162
  };
150
163
  };
@@ -1,6 +1,6 @@
1
1
  // #region Imports
2
2
  import { AddColumnStep } from '@atlaskit/custom-steps';
3
- import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
3
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
4
4
  import { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { TableMap } from '@atlaskit/editor-tables/table-map';
@@ -157,6 +157,19 @@ export var insertTableWithSize = function insertTableWithSize(editorAnalyticsAPI
157
157
  colsCount: colsCount
158
158
  });
159
159
  var newTr = safeInsert(tableNode)(tr).scrollIntoView();
160
+ if (inputMethod) {
161
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
162
+ action: ACTION.INSERTED,
163
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
164
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
165
+ attributes: {
166
+ inputMethod: inputMethod,
167
+ totalRowCount: rowsCount,
168
+ totalColumnCount: colsCount
169
+ },
170
+ eventType: EVENT_TYPE.TRACK
171
+ })(newTr);
172
+ }
160
173
  return newTr;
161
174
  };
162
175
  };
@@ -8,4 +8,4 @@ export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContaine
8
8
  export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
9
9
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
10
10
  export declare const createTable: () => Command;
11
- export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
11
+ export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
@@ -24,7 +24,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
24
24
  insertTable: InsertTableAction;
25
25
  };
26
26
  commands: {
27
- insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
27
+ insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
28
28
  };
29
29
  dependencies: [
30
30
  AnalyticsPlugin,
@@ -8,4 +8,4 @@ export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContaine
8
8
  export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
9
9
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
10
10
  export declare const createTable: () => Command;
11
- export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
11
+ export declare const insertTableWithSize: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
@@ -24,7 +24,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
24
24
  insertTable: InsertTableAction;
25
25
  };
26
26
  commands: {
27
- insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER | INPUT_METHOD.ASCII | INPUT_METHOD.TYPEAHEAD) => EditorCommand;
27
+ insertTableWithSize: (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
28
28
  };
29
29
  dependencies: [
30
30
  AnalyticsPlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "6.1.0",
3
+ "version": "7.0.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^35.3.0",
32
32
  "@atlaskit/custom-steps": "^0.0.11",
33
- "@atlaskit/editor-common": "^76.41.0",
33
+ "@atlaskit/editor-common": "^77.0.0",
34
34
  "@atlaskit/editor-palette": "1.5.2",
35
35
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
36
36
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
@@ -4,7 +4,13 @@ import type {
4
4
  EditorAnalyticsAPI,
5
5
  INPUT_METHOD,
6
6
  } from '@atlaskit/editor-common/analytics';
7
- import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
7
+ import {
8
+ ACTION,
9
+ ACTION_SUBJECT,
10
+ ACTION_SUBJECT_ID,
11
+ EVENT_TYPE,
12
+ TABLE_OVERFLOW_CHANGE_TRIGGER,
13
+ } from '@atlaskit/editor-common/analytics';
8
14
  import type {
9
15
  Command,
10
16
  EditorCommand,
@@ -210,10 +216,7 @@ export const insertTableWithSize =
210
216
  (
211
217
  rowsCount: number,
212
218
  colsCount: number,
213
- inputMethod?:
214
- | INPUT_METHOD.PICKER
215
- | INPUT_METHOD.ASCII
216
- | INPUT_METHOD.TYPEAHEAD,
219
+ inputMethod?: INPUT_METHOD.PICKER,
217
220
  ): EditorCommand => {
218
221
  return ({ tr }) => {
219
222
  const tableNode = createTableNode({
@@ -222,6 +225,19 @@ export const insertTableWithSize =
222
225
  colsCount: colsCount,
223
226
  });
224
227
  const newTr = safeInsert(tableNode)(tr).scrollIntoView();
228
+ if (inputMethod) {
229
+ editorAnalyticsAPI?.attachAnalyticsEvent({
230
+ action: ACTION.INSERTED,
231
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
232
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
233
+ attributes: {
234
+ inputMethod: inputMethod,
235
+ totalRowCount: rowsCount,
236
+ totalColumnCount: colsCount,
237
+ },
238
+ eventType: EVENT_TYPE.TRACK,
239
+ })(newTr);
240
+ }
225
241
  return newTr;
226
242
  };
227
243
  };
package/src/plugin.tsx CHANGED
@@ -110,10 +110,7 @@ export type TablePlugin = NextEditorPlugin<
110
110
  insertTableWithSize: (
111
111
  rowsCount: number,
112
112
  colsCount: number,
113
- inputMethod?:
114
- | INPUT_METHOD.PICKER
115
- | INPUT_METHOD.ASCII
116
- | INPUT_METHOD.TYPEAHEAD,
113
+ inputMethod?: INPUT_METHOD.PICKER,
117
114
  ) => EditorCommand;
118
115
  };
119
116
  dependencies: [