@atlaskit/editor-plugin-table 23.3.6 → 23.3.7

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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 23.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1df102e80b904`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1df102e80b904) -
8
+ Add parentNode field in insert table events to track panel_c1 -> table
9
+ - Updated dependencies
10
+
3
11
  ## 23.3.6
4
12
 
5
13
  ### Patch Changes
@@ -15,6 +15,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _utils = require("@atlaskit/editor-prosemirror/utils");
16
16
  var _tableMap = require("@atlaskit/editor-tables/table-map");
17
17
  var _utils2 = require("@atlaskit/editor-tables/utils");
18
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
19
  var _commands = require("../analytics/commands");
19
20
  var _tableAnalytics = require("../table-analytics");
20
21
  var _columnWidth = require("../transforms/column-width");
@@ -175,13 +176,16 @@ var createTable = exports.createTable = function createTable(isTableScalingEnabl
175
176
  if (dispatch) {
176
177
  var tr = (0, _utils.safeInsert)(table)(state.tr).scrollIntoView();
177
178
  if (editorAnalyticsAPI) {
179
+ var _state$selection$$fro;
178
180
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
179
181
  action: _analytics.ACTION.INSERTED,
180
182
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
181
183
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
182
- attributes: {
184
+ attributes: _objectSpread({
183
185
  inputMethod: _analytics.INPUT_METHOD.SHORTCUT
184
- },
186
+ }, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
187
+ parentNode: (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type.name
188
+ } : {}),
185
189
  eventType: _analytics.EVENT_TYPE.TRACK
186
190
  })(tr);
187
191
  }
@@ -214,15 +218,18 @@ var insertTableWithSize = exports.insertTableWithSize = function insertTableWith
214
218
  })(tr.doc.type.schema);
215
219
  var newTr = (0, _utils.safeInsert)(tableNode)(tr).scrollIntoView();
216
220
  if (inputMethod) {
221
+ var _tr$selection$$from$n;
217
222
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
218
223
  action: _analytics.ACTION.INSERTED,
219
224
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
220
225
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
221
- attributes: {
226
+ attributes: _objectSpread({
222
227
  inputMethod: inputMethod,
223
228
  totalRowCount: rowsCount,
224
229
  totalColumnCount: colsCount
225
- },
230
+ }, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
231
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
232
+ } : {}),
226
233
  eventType: _analytics.EVENT_TYPE.TRACK
227
234
  })(newTr);
228
235
  }
@@ -265,7 +272,7 @@ var insertTableWithNestingSupport = exports.insertTableWithNestingSupport = func
265
272
  _ref2$createTableProp = _ref2.createTableProps,
266
273
  createTableProps = _ref2$createTableProp === void 0 ? {} : _ref2$createTableProp;
267
274
  return function (_ref3) {
268
- var _api$contentInsertion;
275
+ var _api$contentInsertion, _tr$selection$$from$n2;
269
276
  var tr = _ref3.tr;
270
277
  var schema = tr.doc.type.schema;
271
278
 
@@ -303,7 +310,9 @@ var insertTableWithNestingSupport = exports.insertTableWithNestingSupport = func
303
310
  analyticsPayload: analyticsPayload ? _objectSpread(_objectSpread({}, analyticsPayload), {}, {
304
311
  attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
305
312
  localId: node.attrs.localId
306
- })
313
+ }, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
314
+ parentNode: (_tr$selection$$from$n2 = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n2 === void 0 ? void 0 : _tr$selection$$from$n2.type.name
315
+ } : {})
307
316
  }) : undefined,
308
317
  insertAt: insertAt
309
318
  }
@@ -563,7 +563,7 @@ var tablePlugin = function tablePlugin(_ref) {
563
563
  return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
564
564
  },
565
565
  action: function action(insert, state) {
566
- var _api$table, _options$tableOptions6;
566
+ var _api$table, _options$tableOptions6, _tr$selection$$from$n;
567
567
  if (isTableSelectorEnabled) {
568
568
  var _tr = insert('');
569
569
  _tr.setMeta(_tableSizeSelector.pluginKey, {
@@ -607,10 +607,12 @@ var tablePlugin = function tablePlugin(_ref) {
607
607
  action: _analytics.ACTION.INSERTED,
608
608
  actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
609
609
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
610
- attributes: {
610
+ attributes: _objectSpread({
611
611
  inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT,
612
612
  localId: tableNode.attrs.localId
613
- },
613
+ }, (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
614
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
615
+ } : {}),
614
616
  eventType: _analytics.EVENT_TYPE.TRACK
615
617
  })(tr);
616
618
  return tr;
@@ -6,6 +6,7 @@ import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { TableMap } from '@atlaskit/editor-tables/table-map';
8
8
  import { addColumnAt as addColumnAtPMUtils, addRowAt, findTable, selectedRect } from '@atlaskit/editor-tables/utils';
9
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { updateRowOrColumnMovedTransform } from '../analytics/commands';
10
11
  import { META_KEYS } from '../table-analytics';
11
12
  import { rescaleColumns } from '../transforms/column-width';
@@ -141,12 +142,16 @@ export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFu
141
142
  if (dispatch) {
142
143
  const tr = safeInsert(table)(state.tr).scrollIntoView();
143
144
  if (editorAnalyticsAPI) {
145
+ var _state$selection$$fro;
144
146
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
145
147
  action: ACTION.INSERTED,
146
148
  actionSubject: ACTION_SUBJECT.DOCUMENT,
147
149
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
148
150
  attributes: {
149
- inputMethod: INPUT_METHOD.SHORTCUT
151
+ inputMethod: INPUT_METHOD.SHORTCUT,
152
+ ...(expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
153
+ parentNode: (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type.name
154
+ } : {})
150
155
  },
151
156
  eventType: EVENT_TYPE.TRACK
152
157
  })(tr);
@@ -179,6 +184,7 @@ export const insertTableWithSize = (isFullWidthModeEnabled, isMaxWidthModeEnable
179
184
  })(tr.doc.type.schema);
180
185
  const newTr = safeInsert(tableNode)(tr).scrollIntoView();
181
186
  if (inputMethod) {
187
+ var _tr$selection$$from$n;
182
188
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
183
189
  action: ACTION.INSERTED,
184
190
  actionSubject: ACTION_SUBJECT.DOCUMENT,
@@ -186,7 +192,10 @@ export const insertTableWithSize = (isFullWidthModeEnabled, isMaxWidthModeEnable
186
192
  attributes: {
187
193
  inputMethod: inputMethod,
188
194
  totalRowCount: rowsCount,
189
- totalColumnCount: colsCount
195
+ totalColumnCount: colsCount,
196
+ ...(expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
197
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
198
+ } : {})
190
199
  },
191
200
  eventType: EVENT_TYPE.TRACK
192
201
  })(newTr);
@@ -223,7 +232,7 @@ export const insertTableWithNestingSupport = ({
223
232
  }, api, analyticsPayload) => ({
224
233
  tr
225
234
  }) => {
226
- var _api$contentInsertion, _api$contentInsertion2;
235
+ var _api$contentInsertion, _api$contentInsertion2, _tr$selection$$from$n2;
227
236
  const {
228
237
  schema
229
238
  } = tr.doc.type;
@@ -263,7 +272,10 @@ export const insertTableWithNestingSupport = ({
263
272
  ...analyticsPayload,
264
273
  attributes: {
265
274
  ...analyticsPayload.attributes,
266
- localId: node.attrs.localId
275
+ localId: node.attrs.localId,
276
+ ...(expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
277
+ parentNode: (_tr$selection$$from$n2 = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n2 === void 0 ? void 0 : _tr$selection$$from$n2.type.name
278
+ } : {})
267
279
  }
268
280
  } : undefined,
269
281
  insertAt
@@ -544,7 +544,7 @@ const tablePlugin = ({
544
544
  keyshortcut: tooltip(toggleTable),
545
545
  icon: () => /*#__PURE__*/React.createElement(IconTable, null),
546
546
  action(insert, state) {
547
- var _api$table, _options$tableOptions6;
547
+ var _api$table, _options$tableOptions6, _tr$selection$$from$n;
548
548
  if (isTableSelectorEnabled) {
549
549
  const tr = insert('');
550
550
  tr.setMeta(sizeSelectorPluginKey, {
@@ -593,7 +593,10 @@ const tablePlugin = ({
593
593
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
594
594
  attributes: {
595
595
  inputMethod: INPUT_METHOD.QUICK_INSERT,
596
- localId: tableNode.attrs.localId
596
+ localId: tableNode.attrs.localId,
597
+ ...(expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
598
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
599
+ } : {})
597
600
  },
598
601
  eventType: EVENT_TYPE.TRACK
599
602
  })(tr);
@@ -9,6 +9,7 @@ import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { TableMap } from '@atlaskit/editor-tables/table-map';
11
11
  import { addColumnAt as addColumnAtPMUtils, addRowAt, findTable, selectedRect } from '@atlaskit/editor-tables/utils';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  import { updateRowOrColumnMovedTransform } from '../analytics/commands';
13
14
  import { META_KEYS } from '../table-analytics';
14
15
  import { rescaleColumns } from '../transforms/column-width';
@@ -167,13 +168,16 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
167
168
  if (dispatch) {
168
169
  var tr = safeInsert(table)(state.tr).scrollIntoView();
169
170
  if (editorAnalyticsAPI) {
171
+ var _state$selection$$fro;
170
172
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
171
173
  action: ACTION.INSERTED,
172
174
  actionSubject: ACTION_SUBJECT.DOCUMENT,
173
175
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
174
- attributes: {
176
+ attributes: _objectSpread({
175
177
  inputMethod: INPUT_METHOD.SHORTCUT
176
- },
178
+ }, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
179
+ parentNode: (_state$selection$$fro = state.selection.$from.node(-1)) === null || _state$selection$$fro === void 0 ? void 0 : _state$selection$$fro.type.name
180
+ } : {}),
177
181
  eventType: EVENT_TYPE.TRACK
178
182
  })(tr);
179
183
  }
@@ -206,15 +210,18 @@ export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEna
206
210
  })(tr.doc.type.schema);
207
211
  var newTr = safeInsert(tableNode)(tr).scrollIntoView();
208
212
  if (inputMethod) {
213
+ var _tr$selection$$from$n;
209
214
  editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
210
215
  action: ACTION.INSERTED,
211
216
  actionSubject: ACTION_SUBJECT.DOCUMENT,
212
217
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
213
- attributes: {
218
+ attributes: _objectSpread({
214
219
  inputMethod: inputMethod,
215
220
  totalRowCount: rowsCount,
216
221
  totalColumnCount: colsCount
217
- },
222
+ }, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
223
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
224
+ } : {}),
218
225
  eventType: EVENT_TYPE.TRACK
219
226
  })(newTr);
220
227
  }
@@ -257,7 +264,7 @@ export var insertTableWithNestingSupport = function insertTableWithNestingSuppor
257
264
  _ref2$createTableProp = _ref2.createTableProps,
258
265
  createTableProps = _ref2$createTableProp === void 0 ? {} : _ref2$createTableProp;
259
266
  return function (_ref3) {
260
- var _api$contentInsertion;
267
+ var _api$contentInsertion, _tr$selection$$from$n2;
261
268
  var tr = _ref3.tr;
262
269
  var schema = tr.doc.type.schema;
263
270
 
@@ -295,7 +302,9 @@ export var insertTableWithNestingSupport = function insertTableWithNestingSuppor
295
302
  analyticsPayload: analyticsPayload ? _objectSpread(_objectSpread({}, analyticsPayload), {}, {
296
303
  attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
297
304
  localId: node.attrs.localId
298
- })
305
+ }, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
306
+ parentNode: (_tr$selection$$from$n2 = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n2 === void 0 ? void 0 : _tr$selection$$from$n2.type.name
307
+ } : {})
299
308
  }) : undefined,
300
309
  insertAt: insertAt
301
310
  }
@@ -554,7 +554,7 @@ var tablePlugin = function tablePlugin(_ref) {
554
554
  return /*#__PURE__*/React.createElement(IconTable, null);
555
555
  },
556
556
  action: function action(insert, state) {
557
- var _api$table, _options$tableOptions6;
557
+ var _api$table, _options$tableOptions6, _tr$selection$$from$n;
558
558
  if (isTableSelectorEnabled) {
559
559
  var _tr = insert('');
560
560
  _tr.setMeta(sizeSelectorPluginKey, {
@@ -598,10 +598,12 @@ var tablePlugin = function tablePlugin(_ref) {
598
598
  action: ACTION.INSERTED,
599
599
  actionSubject: ACTION_SUBJECT.DOCUMENT,
600
600
  actionSubjectId: ACTION_SUBJECT_ID.TABLE,
601
- attributes: {
601
+ attributes: _objectSpread({
602
602
  inputMethod: INPUT_METHOD.QUICK_INSERT,
603
603
  localId: tableNode.attrs.localId
604
- },
604
+ }, expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? {
605
+ parentNode: (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type.name
606
+ } : {}),
605
607
  eventType: EVENT_TYPE.TRACK
606
608
  })(tr);
607
609
  return tr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "23.3.6",
3
+ "version": "23.3.7",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,7 +28,7 @@
28
28
  "singleton": true
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^52.16.0",
31
+ "@atlaskit/adf-schema": "^53.0.0",
32
32
  "@atlaskit/button": "^23.11.0",
33
33
  "@atlaskit/custom-steps": "^0.17.0",
34
34
  "@atlaskit/editor-palette": "^2.2.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^11.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^11.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^13.0.0",
40
- "@atlaskit/editor-plugin-extension": "14.1.5",
40
+ "@atlaskit/editor-plugin-extension": "14.1.6",
41
41
  "@atlaskit/editor-plugin-guideline": "^11.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^20.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^8.0.0",
@@ -75,7 +75,7 @@
75
75
  "uuid": "^3.1.0"
76
76
  },
77
77
  "peerDependencies": {
78
- "@atlaskit/editor-common": "^115.8.0",
78
+ "@atlaskit/editor-common": "^115.10.0",
79
79
  "react": "^18.2.0",
80
80
  "react-dom": "^18.2.0",
81
81
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"