@atlaskit/editor-plugin-table 5.3.36 → 5.3.38

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,41 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 5.3.38
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646) [`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make feature flags plugin optional in all plugins including:
8
+
9
+ - analytics
10
+ - base
11
+ - card
12
+ - code-block
13
+ - expand
14
+ - extension
15
+ - floating-toolbar
16
+ - hyperlink
17
+ - insert-block
18
+ - layout
19
+ - layout
20
+ - list
21
+ - media
22
+ - paste
23
+ - rule
24
+ - table
25
+ - tasks-and-decisions
26
+
27
+ We already treat it as optional in the plugins, so this is just ensuring that the plugin is not mandatory to be added to the preset.
28
+
29
+ - Updated dependencies
30
+
31
+ ## 5.3.37
32
+
33
+ ### Patch Changes
34
+
35
+ - [#42221](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42221) [`7fd1f8bb312`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7fd1f8bb312) - revert pr 42221
36
+ - [#43417](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43417) [`3f3c17f0273`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f3c17f0273) - ED-20971 Upgrade adf-schema package to ^34.0.0
37
+ - Updated dependencies
38
+
3
39
  ## 5.3.36
4
40
 
5
41
  ### Patch Changes
@@ -3,13 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.shiftArrowUpFromTable = exports.selectRows = exports.selectColumns = exports.arrowRightFromTable = exports.arrowLeftFromTable = exports.TableSelectionDirection = void 0;
6
+ exports.shiftArrowUpFromTable = exports.arrowRightFromTable = exports.arrowLeftFromTable = exports.TableSelectionDirection = void 0;
7
7
  var _selection = require("@atlaskit/editor-common/selection");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
10
10
  var _tableMap = require("@atlaskit/editor-tables/table-map");
11
11
  var _utils = require("@atlaskit/editor-tables/utils");
12
- var _misc = require("../commands/misc");
13
12
  var _toolbar = require("../toolbar");
14
13
  var TableSelectionDirection = exports.TableSelectionDirection = /*#__PURE__*/function (TableSelectionDirection) {
15
14
  TableSelectionDirection["TopToBottom"] = "TopToBottom";
@@ -46,46 +45,6 @@ var arrowRightFromTable = exports.arrowRightFromTable = function arrowRightFromT
46
45
  };
47
46
  };
48
47
  };
49
- var selectColumns = exports.selectColumns = function selectColumns(editorSelectionAPI) {
50
- return function () {
51
- return function (state, dispatch) {
52
- var selection = state.selection;
53
- var table = (0, _utils.findTable)(selection);
54
- var rect = (0, _utils.selectedRect)(state);
55
- if (table && (0, _utils.isRowSelected)(rect.top)(selection)) {
56
- return selectFullTable(editorSelectionAPI)({
57
- node: table.node,
58
- startPos: table.start,
59
- dir: TableSelectionDirection.BottomToTop
60
- })(state, dispatch);
61
- }
62
- if (table && rect) {
63
- return (0, _misc.selectColumn)(rect.left)(state, dispatch);
64
- }
65
- return false;
66
- };
67
- };
68
- };
69
- var selectRows = exports.selectRows = function selectRows(editorSelectionAPI) {
70
- return function () {
71
- return function (state, dispatch) {
72
- var selection = state.selection;
73
- var table = (0, _utils.findTable)(selection);
74
- var rect = (0, _utils.selectedRect)(state);
75
- if (table && (0, _utils.isColumnSelected)(rect.left)(selection)) {
76
- return selectFullTable(editorSelectionAPI)({
77
- node: table.node,
78
- startPos: table.start,
79
- dir: TableSelectionDirection.BottomToTop
80
- })(state, dispatch);
81
- }
82
- if (table && rect) {
83
- return (0, _misc.selectRow)(rect.top)(state, dispatch);
84
- }
85
- return false;
86
- };
87
- };
88
- };
89
48
  var arrowLeftFromCellSelection = function arrowLeftFromCellSelection(editorSelectionAPI) {
90
49
  return function (selection) {
91
50
  return function (state, dispatch) {
@@ -16,8 +16,6 @@ function tableSelectionKeymapPlugin(editorSelectionAPI) {
16
16
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.shift-arrowup-fix')) {
17
17
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.shiftArrowUp.common, (0, _selection.shiftArrowUpFromTable)(editorSelectionAPI)(), list);
18
18
  }
19
- (0, _keymaps.bindKeymapWithCommand)(_keymaps.selectColumn.common, (0, _selection.selectColumns)(editorSelectionAPI)(), list);
20
- (0, _keymaps.bindKeymapWithCommand)(_keymaps.selectRow.common, (0, _selection.selectRows)(editorSelectionAPI)(), list);
21
19
  return (0, _keymap.keymap)(list);
22
20
  }
23
21
  var _default = exports.default = tableSelectionKeymapPlugin;
@@ -2,8 +2,7 @@ import { GapCursorSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, R
2
2
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
4
  import { TableMap } from '@atlaskit/editor-tables/table-map';
5
- import { findTable, isColumnSelected, isRowSelected, isTableSelected, selectedRect } from '@atlaskit/editor-tables/utils';
6
- import { selectColumn, selectRow } from '../commands/misc';
5
+ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
7
6
  import { getClosestSelectionRect } from '../toolbar';
8
7
  export let TableSelectionDirection = /*#__PURE__*/function (TableSelectionDirection) {
9
8
  TableSelectionDirection["TopToBottom"] = "TopToBottom";
@@ -36,42 +35,6 @@ export const arrowRightFromTable = editorSelectionAPI => () => (state, dispatch)
36
35
  }
37
36
  return false;
38
37
  };
39
- export const selectColumns = editorSelectionAPI => () => (state, dispatch) => {
40
- const {
41
- selection
42
- } = state;
43
- const table = findTable(selection);
44
- const rect = selectedRect(state);
45
- if (table && isRowSelected(rect.top)(selection)) {
46
- return selectFullTable(editorSelectionAPI)({
47
- node: table.node,
48
- startPos: table.start,
49
- dir: TableSelectionDirection.BottomToTop
50
- })(state, dispatch);
51
- }
52
- if (table && rect) {
53
- return selectColumn(rect.left)(state, dispatch);
54
- }
55
- return false;
56
- };
57
- export const selectRows = editorSelectionAPI => () => (state, dispatch) => {
58
- const {
59
- selection
60
- } = state;
61
- const table = findTable(selection);
62
- const rect = selectedRect(state);
63
- if (table && isColumnSelected(rect.left)(selection)) {
64
- return selectFullTable(editorSelectionAPI)({
65
- node: table.node,
66
- startPos: table.start,
67
- dir: TableSelectionDirection.BottomToTop
68
- })(state, dispatch);
69
- }
70
- if (table && rect) {
71
- return selectRow(rect.top)(state, dispatch);
72
- }
73
- return false;
74
- };
75
38
  const arrowLeftFromCellSelection = editorSelectionAPI => selection => (state, dispatch) => {
76
39
  if (isTableSelected(state.selection) && editorSelectionAPI) {
77
40
  const selectionState = editorSelectionAPI.sharedState.currentState() || {};
@@ -1,7 +1,7 @@
1
- import { bindKeymapWithCommand, moveLeft, moveRight, selectColumn, selectRow, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
1
+ import { bindKeymapWithCommand, moveLeft, moveRight, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
- import { arrowLeftFromTable, arrowRightFromTable, selectColumns, selectRows, shiftArrowUpFromTable } from '../commands/selection';
4
+ import { arrowLeftFromTable, arrowRightFromTable, shiftArrowUpFromTable } from '../commands/selection';
5
5
  export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
6
  const list = {};
7
7
  bindKeymapWithCommand(moveRight.common, arrowRightFromTable(editorSelectionAPI)(), list);
@@ -9,8 +9,6 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
9
9
  if (getBooleanFF('platform.editor.table.shift-arrowup-fix')) {
10
10
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
11
11
  }
12
- bindKeymapWithCommand(selectColumn.common, selectColumns(editorSelectionAPI)(), list);
13
- bindKeymapWithCommand(selectRow.common, selectRows(editorSelectionAPI)(), list);
14
12
  return keymap(list);
15
13
  }
16
14
  export default tableSelectionKeymapPlugin;
@@ -2,8 +2,7 @@ import { GapCursorSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, R
2
2
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
4
  import { TableMap } from '@atlaskit/editor-tables/table-map';
5
- import { findTable, isColumnSelected, isRowSelected, isTableSelected, selectedRect } from '@atlaskit/editor-tables/utils';
6
- import { selectColumn, selectRow } from '../commands/misc';
5
+ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
7
6
  import { getClosestSelectionRect } from '../toolbar';
8
7
  export var TableSelectionDirection = /*#__PURE__*/function (TableSelectionDirection) {
9
8
  TableSelectionDirection["TopToBottom"] = "TopToBottom";
@@ -40,46 +39,6 @@ export var arrowRightFromTable = function arrowRightFromTable(editorSelectionAPI
40
39
  };
41
40
  };
42
41
  };
43
- export var selectColumns = function selectColumns(editorSelectionAPI) {
44
- return function () {
45
- return function (state, dispatch) {
46
- var selection = state.selection;
47
- var table = findTable(selection);
48
- var rect = selectedRect(state);
49
- if (table && isRowSelected(rect.top)(selection)) {
50
- return selectFullTable(editorSelectionAPI)({
51
- node: table.node,
52
- startPos: table.start,
53
- dir: TableSelectionDirection.BottomToTop
54
- })(state, dispatch);
55
- }
56
- if (table && rect) {
57
- return selectColumn(rect.left)(state, dispatch);
58
- }
59
- return false;
60
- };
61
- };
62
- };
63
- export var selectRows = function selectRows(editorSelectionAPI) {
64
- return function () {
65
- return function (state, dispatch) {
66
- var selection = state.selection;
67
- var table = findTable(selection);
68
- var rect = selectedRect(state);
69
- if (table && isColumnSelected(rect.left)(selection)) {
70
- return selectFullTable(editorSelectionAPI)({
71
- node: table.node,
72
- startPos: table.start,
73
- dir: TableSelectionDirection.BottomToTop
74
- })(state, dispatch);
75
- }
76
- if (table && rect) {
77
- return selectRow(rect.top)(state, dispatch);
78
- }
79
- return false;
80
- };
81
- };
82
- };
83
42
  var arrowLeftFromCellSelection = function arrowLeftFromCellSelection(editorSelectionAPI) {
84
43
  return function (selection) {
85
44
  return function (state, dispatch) {
@@ -1,7 +1,7 @@
1
- import { bindKeymapWithCommand, moveLeft, moveRight, selectColumn, selectRow, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
1
+ import { bindKeymapWithCommand, moveLeft, moveRight, shiftArrowUp } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
- import { arrowLeftFromTable, arrowRightFromTable, selectColumns, selectRows, shiftArrowUpFromTable } from '../commands/selection';
4
+ import { arrowLeftFromTable, arrowRightFromTable, shiftArrowUpFromTable } from '../commands/selection';
5
5
  export function tableSelectionKeymapPlugin(editorSelectionAPI) {
6
6
  var list = {};
7
7
  bindKeymapWithCommand(moveRight.common, arrowRightFromTable(editorSelectionAPI)(), list);
@@ -9,8 +9,6 @@ export function tableSelectionKeymapPlugin(editorSelectionAPI) {
9
9
  if (getBooleanFF('platform.editor.table.shift-arrowup-fix')) {
10
10
  bindKeymapWithCommand(shiftArrowUp.common, shiftArrowUpFromTable(editorSelectionAPI)(), list);
11
11
  }
12
- bindKeymapWithCommand(selectColumn.common, selectColumns(editorSelectionAPI)(), list);
13
- bindKeymapWithCommand(selectRow.common, selectRows(editorSelectionAPI)(), list);
14
12
  return keymap(list);
15
13
  }
16
14
  export default tableSelectionKeymapPlugin;
@@ -6,6 +6,4 @@ export declare enum TableSelectionDirection {
6
6
  }
7
7
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
8
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
11
9
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -6,6 +6,4 @@ export declare enum TableSelectionDirection {
6
6
  }
7
7
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
8
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
11
9
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "5.3.36",
3
+ "version": "5.3.38",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,8 +27,8 @@
27
27
  "releaseModel": "continuous"
28
28
  },
29
29
  "dependencies": {
30
- "@atlaskit/adf-schema": "^33.2.3",
31
- "@atlaskit/custom-steps": "^0.0.3",
30
+ "@atlaskit/adf-schema": "^34.0.0",
31
+ "@atlaskit/custom-steps": "^0.0.4",
32
32
  "@atlaskit/editor-common": "^76.22.0",
33
33
  "@atlaskit/editor-palette": "1.5.2",
34
34
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
45
45
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^0.7.0",
46
46
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",
47
- "@atlaskit/primitives": "^1.11.0",
47
+ "@atlaskit/primitives": "^1.12.0",
48
48
  "@atlaskit/theme": "^12.6.0",
49
49
  "@atlaskit/tokens": "^1.28.0",
50
50
  "@atlaskit/tooltip": "^18.0.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/editor-plugin-decorations": "^0.2.0",
67
67
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
68
68
  "@atlaskit/editor-plugin-grid": "^0.3.0",
69
- "@atlaskit/editor-plugin-hyperlink": "^0.5.0",
69
+ "@atlaskit/editor-plugin-hyperlink": "^0.6.0",
70
70
  "@atlaskit/visual-regression": "*",
71
71
  "@atlaskit/webdriver-runner": "*",
72
72
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -2,7 +2,6 @@ import type { DocBuilder } from '@atlaskit/editor-common/types';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
3
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
4
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
5
- import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
5
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
7
6
  import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
8
7
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
@@ -37,7 +36,6 @@ describe('table merging logic', () => {
37
36
  createEditor({
38
37
  doc,
39
38
  preset: new Preset<LightEditorPlugin>()
40
- .add([featureFlagsPlugin, {}])
41
39
  .add([analyticsPlugin, {}])
42
40
  .add(contentInsertionPlugin)
43
41
  .add(widthPlugin)
@@ -3,7 +3,6 @@ import type { DocBuilder } from '@atlaskit/editor-common/types';
3
3
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
4
4
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
5
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
- import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
7
6
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
8
7
  import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
9
8
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
@@ -46,7 +45,6 @@ describe('table plugin: utils/row-controls.js', () => {
46
45
  createEditor({
47
46
  doc,
48
47
  preset: new Preset<LightEditorPlugin>()
49
- .add([featureFlagsPlugin, {}])
50
48
  .add([analyticsPlugin, {}])
51
49
  .add(contentInsertionPlugin)
52
50
  .add(widthPlugin)
@@ -17,15 +17,8 @@ import type {
17
17
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
18
18
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
19
19
  import { TableMap } from '@atlaskit/editor-tables/table-map';
20
- import {
21
- findTable,
22
- isColumnSelected,
23
- isRowSelected,
24
- isTableSelected,
25
- selectedRect,
26
- } from '@atlaskit/editor-tables/utils';
27
-
28
- import { selectColumn, selectRow } from '../commands/misc';
20
+ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
21
+
29
22
  import type tablePlugin from '../index';
30
23
  import { getClosestSelectionRect } from '../toolbar';
31
24
 
@@ -85,60 +78,6 @@ export const arrowRightFromTable =
85
78
  return false;
86
79
  };
87
80
 
88
- export const selectColumns =
89
- (
90
- editorSelectionAPI:
91
- | ExtractInjectionAPI<typeof tablePlugin>['selection']
92
- | undefined,
93
- ) =>
94
- (): Command =>
95
- (state, dispatch) => {
96
- const { selection } = state;
97
- const table = findTable(selection);
98
- const rect = selectedRect(state);
99
-
100
- if (table && isRowSelected(rect.top)(selection)) {
101
- return selectFullTable(editorSelectionAPI)({
102
- node: table.node,
103
- startPos: table.start,
104
- dir: TableSelectionDirection.BottomToTop,
105
- })(state, dispatch);
106
- }
107
-
108
- if (table && rect) {
109
- return selectColumn(rect.left)(state, dispatch);
110
- }
111
-
112
- return false;
113
- };
114
-
115
- export const selectRows =
116
- (
117
- editorSelectionAPI:
118
- | ExtractInjectionAPI<typeof tablePlugin>['selection']
119
- | undefined,
120
- ) =>
121
- (): Command =>
122
- (state, dispatch) => {
123
- const { selection } = state;
124
- const table = findTable(selection);
125
- const rect = selectedRect(state);
126
-
127
- if (table && isColumnSelected(rect.left)(selection)) {
128
- return selectFullTable(editorSelectionAPI)({
129
- node: table.node,
130
- startPos: table.start,
131
- dir: TableSelectionDirection.BottomToTop,
132
- })(state, dispatch);
133
- }
134
-
135
- if (table && rect) {
136
- return selectRow(rect.top)(state, dispatch);
137
- }
138
-
139
- return false;
140
- };
141
-
142
81
  const arrowLeftFromCellSelection =
143
82
  (
144
83
  editorSelectionAPI:
@@ -2,8 +2,6 @@ import {
2
2
  bindKeymapWithCommand,
3
3
  moveLeft,
4
4
  moveRight,
5
- selectColumn,
6
- selectRow,
7
5
  shiftArrowUp,
8
6
  } from '@atlaskit/editor-common/keymaps';
9
7
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -14,8 +12,6 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
12
  import {
15
13
  arrowLeftFromTable,
16
14
  arrowRightFromTable,
17
- selectColumns,
18
- selectRows,
19
15
  shiftArrowUpFromTable,
20
16
  } from '../commands/selection';
21
17
  import type tablePlugin from '../index';
@@ -47,18 +43,6 @@ export function tableSelectionKeymapPlugin(
47
43
  );
48
44
  }
49
45
 
50
- bindKeymapWithCommand(
51
- selectColumn.common!,
52
- selectColumns(editorSelectionAPI)(),
53
- list,
54
- );
55
-
56
- bindKeymapWithCommand(
57
- selectRow.common!,
58
- selectRows(editorSelectionAPI)(),
59
- list,
60
- );
61
-
62
46
  return keymap(list) as SafePlugin;
63
47
  }
64
48