@atlaskit/editor-plugin-table 2.7.1 → 2.7.2

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,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 2.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8b104cb7575`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8b104cb7575) - [ED-14769] Remove tableCellOptionsinFloatingToolbar feature flag & make it default behaviour
8
+
3
9
  ## 2.7.1
4
10
 
5
11
  ### Patch Changes
@@ -310,10 +310,8 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
310
310
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
311
311
  var nodeType = state.schema.nodes.table;
312
312
  var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
313
- var _ref3 = getEditorFeatureFlags() || {},
314
- tableCellOptionsInFloatingToolbar = _ref3.tableCellOptionsInFloatingToolbar;
315
- var cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
316
- var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
313
+ var cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI);
314
+ var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI);
317
315
 
318
316
  // Check if we need to show confirm dialog for delete button
319
317
  var confirmDialog;
@@ -403,26 +401,24 @@ var separator = function separator(hidden) {
403
401
  hidden: hidden
404
402
  };
405
403
  };
406
- var getCellItems = function getCellItems(pluginConfig, state, view, _ref4, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
407
- var formatMessage = _ref4.formatMessage;
408
- if (pluginConfig.allowCellOptionsInFloatingToolbar || tableCellOptionsInFloatingToolbar) {
409
- var initialSelectionRect = getClosestSelectionRect(state);
410
- if (initialSelectionRect) {
411
- var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
412
- formatMessage: formatMessage
413
- }, getEditorContainerWidth, editorAnalyticsAPI);
414
- return [cellOptions, separator(cellOptions.hidden)];
415
- }
404
+ var getCellItems = function getCellItems(pluginConfig, state, view, _ref3, getEditorContainerWidth, editorAnalyticsAPI) {
405
+ var formatMessage = _ref3.formatMessage;
406
+ var initialSelectionRect = getClosestSelectionRect(state);
407
+ if (initialSelectionRect) {
408
+ var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
409
+ formatMessage: formatMessage
410
+ }, getEditorContainerWidth, editorAnalyticsAPI);
411
+ return [cellOptions, separator(cellOptions.hidden)];
416
412
  }
417
413
  return [];
418
414
  };
419
- var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
415
+ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalyticsAPI) {
420
416
  var _node$attrs;
421
- var formatMessage = _ref5.formatMessage;
417
+ var formatMessage = _ref4.formatMessage;
422
418
  var _getPluginState2 = (0, _pluginFactory.getPluginState)(state),
423
419
  targetCellPosition = _getPluginState2.targetCellPosition,
424
420
  pluginConfig = _getPluginState2.pluginConfig;
425
- if (!pluginConfig.allowBackgroundColor || !tableCellOptionsInFloatingToolbar) {
421
+ if (!pluginConfig.allowBackgroundColor) {
426
422
  return [];
427
423
  }
428
424
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -300,11 +300,8 @@ export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, ge
300
300
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
301
301
  const nodeType = state.schema.nodes.table;
302
302
  const menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
303
- const {
304
- tableCellOptionsInFloatingToolbar
305
- } = getEditorFeatureFlags() || {};
306
- const cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
307
- const colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
303
+ const cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI);
304
+ const colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI);
308
305
 
309
306
  // Check if we need to show confirm dialog for delete button
310
307
  let confirmDialog;
@@ -386,27 +383,25 @@ const separator = hidden => {
386
383
  };
387
384
  const getCellItems = (pluginConfig, state, view, {
388
385
  formatMessage
389
- }, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) => {
390
- if (pluginConfig.allowCellOptionsInFloatingToolbar || tableCellOptionsInFloatingToolbar) {
391
- const initialSelectionRect = getClosestSelectionRect(state);
392
- if (initialSelectionRect) {
393
- const cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
394
- formatMessage
395
- }, getEditorContainerWidth, editorAnalyticsAPI);
396
- return [cellOptions, separator(cellOptions.hidden)];
397
- }
386
+ }, getEditorContainerWidth, editorAnalyticsAPI) => {
387
+ const initialSelectionRect = getClosestSelectionRect(state);
388
+ if (initialSelectionRect) {
389
+ const cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
390
+ formatMessage
391
+ }, getEditorContainerWidth, editorAnalyticsAPI);
392
+ return [cellOptions, separator(cellOptions.hidden)];
398
393
  }
399
394
  return [];
400
395
  };
401
396
  const getColorPicker = (state, menu, {
402
397
  formatMessage
403
- }, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) => {
398
+ }, editorAnalyticsAPI) => {
404
399
  var _node$attrs;
405
400
  const {
406
401
  targetCellPosition,
407
402
  pluginConfig
408
403
  } = getPluginState(state);
409
- if (!pluginConfig.allowBackgroundColor || !tableCellOptionsInFloatingToolbar) {
404
+ if (!pluginConfig.allowBackgroundColor) {
410
405
  return [];
411
406
  }
412
407
  const node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -299,10 +299,8 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
299
299
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
300
300
  var nodeType = state.schema.nodes.table;
301
301
  var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
302
- var _ref3 = getEditorFeatureFlags() || {},
303
- tableCellOptionsInFloatingToolbar = _ref3.tableCellOptionsInFloatingToolbar;
304
- var cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
305
- var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
302
+ var cellItems = getCellItems(config, state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI);
303
+ var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI);
306
304
 
307
305
  // Check if we need to show confirm dialog for delete button
308
306
  var confirmDialog;
@@ -391,26 +389,24 @@ var separator = function separator(hidden) {
391
389
  hidden: hidden
392
390
  };
393
391
  };
394
- var getCellItems = function getCellItems(pluginConfig, state, view, _ref4, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
395
- var formatMessage = _ref4.formatMessage;
396
- if (pluginConfig.allowCellOptionsInFloatingToolbar || tableCellOptionsInFloatingToolbar) {
397
- var initialSelectionRect = getClosestSelectionRect(state);
398
- if (initialSelectionRect) {
399
- var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
400
- formatMessage: formatMessage
401
- }, getEditorContainerWidth, editorAnalyticsAPI);
402
- return [cellOptions, separator(cellOptions.hidden)];
403
- }
392
+ var getCellItems = function getCellItems(pluginConfig, state, view, _ref3, getEditorContainerWidth, editorAnalyticsAPI) {
393
+ var formatMessage = _ref3.formatMessage;
394
+ var initialSelectionRect = getClosestSelectionRect(state);
395
+ if (initialSelectionRect) {
396
+ var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
397
+ formatMessage: formatMessage
398
+ }, getEditorContainerWidth, editorAnalyticsAPI);
399
+ return [cellOptions, separator(cellOptions.hidden)];
404
400
  }
405
401
  return [];
406
402
  };
407
- var getColorPicker = function getColorPicker(state, menu, _ref5, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
403
+ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalyticsAPI) {
408
404
  var _node$attrs;
409
- var formatMessage = _ref5.formatMessage;
405
+ var formatMessage = _ref4.formatMessage;
410
406
  var _getPluginState2 = getPluginState(state),
411
407
  targetCellPosition = _getPluginState2.targetCellPosition,
412
408
  pluginConfig = _getPluginState2.pluginConfig;
413
- if (!pluginConfig.allowBackgroundColor || !tableCellOptionsInFloatingToolbar) {
409
+ if (!pluginConfig.allowBackgroundColor) {
414
410
  return [];
415
411
  }
416
412
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -38,7 +38,6 @@ export interface PluginConfig {
38
38
  permittedLayouts?: PermittedLayoutsDescriptor;
39
39
  allowControls?: boolean;
40
40
  stickyHeaders?: boolean;
41
- allowCellOptionsInFloatingToolbar?: boolean;
42
41
  tableCellOptimization?: boolean;
43
42
  tableRenderOptimization?: boolean;
44
43
  stickyHeadersOptimization?: boolean;
@@ -38,7 +38,6 @@ export interface PluginConfig {
38
38
  permittedLayouts?: PermittedLayoutsDescriptor;
39
39
  allowControls?: boolean;
40
40
  stickyHeaders?: boolean;
41
- allowCellOptionsInFloatingToolbar?: boolean;
42
41
  tableCellOptimization?: boolean;
43
42
  tableRenderOptimization?: boolean;
44
43
  stickyHeadersOptimization?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
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
  },
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^28.0.0",
31
- "@atlaskit/editor-common": "^74.40.0",
31
+ "@atlaskit/editor-common": "^74.41.0",
32
32
  "@atlaskit/editor-palette": "1.5.1",
33
33
  "@atlaskit/editor-plugin-analytics": "^0.1.0",
34
34
  "@atlaskit/editor-plugin-content-insertion": "^0.0.7",
package/report.api.md CHANGED
@@ -41,8 +41,6 @@ interface PluginConfig {
41
41
  // (undocumented)
42
42
  allowBackgroundColor?: boolean;
43
43
  // (undocumented)
44
- allowCellOptionsInFloatingToolbar?: boolean;
45
- // (undocumented)
46
44
  allowCollapse?: boolean;
47
45
  // (undocumented)
48
46
  allowColumnResizing?: boolean;
@@ -35,7 +35,6 @@ BrowserTestCase(
35
35
  advanced: true,
36
36
  allowColumnSorting: true,
37
37
  allowDistributeColumns: true,
38
- allowCellOptionsInFloatingToolbar: true,
39
38
  },
40
39
  defaultValue: basicTable,
41
40
  });
@@ -91,7 +90,6 @@ BrowserTestCase(
91
90
  advanced: true,
92
91
  allowColumnSorting: true,
93
92
  allowDistributeColumns: true,
94
- allowCellOptionsInFloatingToolbar: true,
95
93
  },
96
94
  defaultValue: basicTable,
97
95
  });
@@ -138,7 +136,6 @@ BrowserTestCase(
138
136
  allowTables: {
139
137
  allowColumnSorting: true,
140
138
  allowDistributeColumns: true,
141
- allowCellOptionsInFloatingToolbar: true,
142
139
  },
143
140
  defaultValue: basicTable,
144
141
  });
@@ -185,7 +182,6 @@ BrowserTestCase(
185
182
  allowTables: {
186
183
  allowColumnSorting: true,
187
184
  allowDistributeColumns: true,
188
- allowCellOptionsInFloatingToolbar: true,
189
185
  },
190
186
  defaultValue: documentWithMergedCells,
191
187
  });
@@ -247,7 +243,6 @@ BrowserTestCase(
247
243
  allowTables: {
248
244
  allowColumnSorting: true,
249
245
  allowDistributeColumns: true,
250
- allowCellOptionsInFloatingToolbar: true,
251
246
  },
252
247
  defaultValue: basicTableWithMergedCell,
253
248
  });
@@ -295,7 +290,6 @@ BrowserTestCase(
295
290
  allowTables: {
296
291
  allowColumnSorting: true,
297
292
  allowDistributeColumns: true,
298
- allowCellOptionsInFloatingToolbar: true,
299
293
  },
300
294
  defaultValue: basicTableWithMergedCell,
301
295
  });
@@ -343,7 +337,6 @@ BrowserTestCase(
343
337
  allowTables: {
344
338
  allowColumnSorting: true,
345
339
  allowDistributeColumns: true,
346
- allowCellOptionsInFloatingToolbar: true,
347
340
  },
348
341
  defaultValue: basicTable,
349
342
  });
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9c8221121bc35d8d4d1dd7b3d30212732802458bbae60bbae450b9b88bdd3ed3
3
- size 14078
2
+ oid sha256:1b71f23d11823e24b9a7ce319b38e1c2625f9d88301ebd4ce03074214202caa2
3
+ size 15206
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7e1eedc6e6df9262101a20fae98396c94f8ea7086cb5a6424bcc01f9b5616810
3
- size 29828
2
+ oid sha256:eca71983bb60a79e2f607ec05ab3d99ff58bc8551b232219dcf24fd8e176fea3
3
+ size 32711
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:185a432916fe30487eec362617c510dd132f2a37a56bfceeca674da4c6512dc9
3
- size 13986
2
+ oid sha256:6f2033158fd0e520d5dff43ca6308b8312b2321e246ffb0604aee1de57368e6b
3
+ size 15136
@@ -1,3 +1,3 @@
1
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:164b040aa0254b6bdc19497a86b9d9a226cde6545661f2f475f87fe9e200f3b5
3
- size 29856
2
+ oid sha256:559ec334bb7930be94de71631ca380ff968ac8d58ce4de6a3dc20881a1e48ab9
3
+ size 32765
@@ -452,8 +452,6 @@ export const getToolbarConfig =
452
452
  editorAnalyticsAPI,
453
453
  );
454
454
 
455
- const { tableCellOptionsInFloatingToolbar } =
456
- getEditorFeatureFlags() || {};
457
455
  const cellItems = getCellItems(
458
456
  config,
459
457
  state,
@@ -461,15 +459,8 @@ export const getToolbarConfig =
461
459
  intl,
462
460
  getEditorContainerWidth,
463
461
  editorAnalyticsAPI,
464
- tableCellOptionsInFloatingToolbar,
465
- );
466
- const colorPicker = getColorPicker(
467
- state,
468
- menu,
469
- intl,
470
- editorAnalyticsAPI,
471
- tableCellOptionsInFloatingToolbar,
472
462
  );
463
+ const colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI);
473
464
 
474
465
  // Check if we need to show confirm dialog for delete button
475
466
  let confirmDialog;
@@ -590,24 +581,18 @@ const getCellItems = (
590
581
  { formatMessage }: ToolbarMenuContext,
591
582
  getEditorContainerWidth: GetEditorContainerWidth,
592
583
  editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
593
- tableCellOptionsInFloatingToolbar?: boolean,
594
584
  ): Array<FloatingToolbarItem<Command>> => {
595
- if (
596
- pluginConfig.allowCellOptionsInFloatingToolbar ||
597
- tableCellOptionsInFloatingToolbar
598
- ) {
599
- const initialSelectionRect = getClosestSelectionRect(state);
600
- if (initialSelectionRect) {
601
- const cellOptions = getToolbarCellOptionsConfig(
602
- state,
603
- view,
604
- initialSelectionRect,
605
- { formatMessage },
606
- getEditorContainerWidth,
607
- editorAnalyticsAPI,
608
- );
609
- return [cellOptions, separator(cellOptions.hidden!)];
610
- }
585
+ const initialSelectionRect = getClosestSelectionRect(state);
586
+ if (initialSelectionRect) {
587
+ const cellOptions = getToolbarCellOptionsConfig(
588
+ state,
589
+ view,
590
+ initialSelectionRect,
591
+ { formatMessage },
592
+ getEditorContainerWidth,
593
+ editorAnalyticsAPI,
594
+ );
595
+ return [cellOptions, separator(cellOptions.hidden!)];
611
596
  }
612
597
  return [];
613
598
  };
@@ -617,13 +602,9 @@ const getColorPicker = (
617
602
  menu: FloatingToolbarItem<Command>,
618
603
  { formatMessage }: ToolbarMenuContext,
619
604
  editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined,
620
- tableCellOptionsInFloatingToolbar?: boolean,
621
605
  ): Array<FloatingToolbarItem<Command>> => {
622
606
  const { targetCellPosition, pluginConfig } = getPluginState(state);
623
- if (
624
- !pluginConfig.allowBackgroundColor ||
625
- !tableCellOptionsInFloatingToolbar
626
- ) {
607
+ if (!pluginConfig.allowBackgroundColor) {
627
608
  return [];
628
609
  }
629
610
  const node = targetCellPosition
@@ -53,7 +53,6 @@ export interface PluginConfig {
53
53
  permittedLayouts?: PermittedLayoutsDescriptor;
54
54
  allowControls?: boolean;
55
55
  stickyHeaders?: boolean;
56
- allowCellOptionsInFloatingToolbar?: boolean;
57
56
  tableCellOptimization?: boolean;
58
57
  tableRenderOptimization?: boolean;
59
58
  stickyHeadersOptimization?: boolean;
@@ -30,8 +30,6 @@ interface PluginConfig {
30
30
  // (undocumented)
31
31
  allowBackgroundColor?: boolean;
32
32
  // (undocumented)
33
- allowCellOptionsInFloatingToolbar?: boolean;
34
- // (undocumented)
35
33
  allowCollapse?: boolean;
36
34
  // (undocumented)
37
35
  allowColumnResizing?: boolean;