@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 +6 -0
- package/dist/cjs/plugins/table/toolbar.js +13 -17
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/toolbar.js +11 -16
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/toolbar.js +13 -17
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +0 -1
- package/package.json +2 -2
- package/report.api.md +0 -2
- package/src/__tests__/integration/floating-toolbar.ts +0 -7
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +2 -2
- package/src/plugins/table/toolbar.tsx +13 -32
- package/src/plugins/table/types.ts +0 -1
- package/tmp/api-report-tmp.d.ts +0 -2
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
|
|
314
|
-
|
|
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,
|
|
407
|
-
var formatMessage =
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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,
|
|
415
|
+
var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalyticsAPI) {
|
|
420
416
|
var _node$attrs;
|
|
421
|
-
var 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
|
|
421
|
+
if (!pluginConfig.allowBackgroundColor) {
|
|
426
422
|
return [];
|
|
427
423
|
}
|
|
428
424
|
var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
|
package/dist/cjs/version.json
CHANGED
|
@@ -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
|
-
|
|
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
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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
|
|
398
|
+
}, editorAnalyticsAPI) => {
|
|
404
399
|
var _node$attrs;
|
|
405
400
|
const {
|
|
406
401
|
targetCellPosition,
|
|
407
402
|
pluginConfig
|
|
408
403
|
} = getPluginState(state);
|
|
409
|
-
if (!pluginConfig.allowBackgroundColor
|
|
404
|
+
if (!pluginConfig.allowBackgroundColor) {
|
|
410
405
|
return [];
|
|
411
406
|
}
|
|
412
407
|
const node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
|
package/dist/es2019/version.json
CHANGED
|
@@ -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
|
|
303
|
-
|
|
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,
|
|
395
|
-
var formatMessage =
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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,
|
|
403
|
+
var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalyticsAPI) {
|
|
408
404
|
var _node$attrs;
|
|
409
|
-
var 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
|
|
409
|
+
if (!pluginConfig.allowBackgroundColor) {
|
|
414
410
|
return [];
|
|
415
411
|
}
|
|
416
412
|
var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
|
package/dist/esm/version.json
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
@@ -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:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:1b71f23d11823e24b9a7ce319b38e1c2625f9d88301ebd4ce03074214202caa2
|
|
3
|
+
size 15206
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:eca71983bb60a79e2f607ec05ab3d99ff58bc8551b232219dcf24fd8e176fea3
|
|
3
|
+
size 32711
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
2
|
+
oid sha256:6f2033158fd0e520d5dff43ca6308b8312b2321e246ffb0604aee1de57368e6b
|
|
3
|
+
size 15136
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
version https://git-lfs.github.com/spec/v1
|
|
2
|
-
oid sha256:
|
|
3
|
-
size
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
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;
|
package/tmp/api-report-tmp.d.ts
CHANGED