@atlaskit/editor-plugin-table 7.22.0 → 7.23.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,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#124209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124209)
8
+ [`8aa1792f12ed3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8aa1792f12ed3) -
9
+ bump @atlaskit/editor-prosemirror to 5.0.0, bump @atlaskit/adf-schema to 40.1.0
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122783](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122783)
14
+ [`c64ead15aa9d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c64ead15aa9d7) -
15
+ [ux] Enabled table alignment in comment editor
16
+ - Updated dependencies
17
+
3
18
  ## 7.22.0
4
19
 
5
20
  ### Minor Changes
@@ -169,7 +169,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
169
169
  }
170
170
  },
171
171
  commands: {
172
- insertTableWithSize: (0, _insert.insertTableWithSize)(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)
172
+ insertTableWithSize: (0, _insert.insertTableWithSize)(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
173
173
  },
174
174
  nodes: function nodes() {
175
175
  return [{
@@ -22,7 +22,7 @@ var createTableWithWidth = exports.createTableWithWidth = function createTableWi
22
22
  if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
23
23
  attrsOverrides.tableWidth = _utils2.TABLE_MAX_WIDTH;
24
24
  }
25
- if (isTableAlignmentEnabled && isFullWidthModeEnabled) {
25
+ if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
26
26
  attrsOverrides.layout = 'align-start';
27
27
  }
28
28
  if (isCommentEditor && isTableResizingEnabled) {
@@ -159,7 +159,7 @@ const tablesPlugin = ({
159
159
  }
160
160
  },
161
161
  commands: {
162
- insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)
162
+ insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
163
163
  },
164
164
  nodes() {
165
165
  return [{
@@ -12,7 +12,7 @@ export const createTableWithWidth = ({
12
12
  if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
13
13
  attrsOverrides.tableWidth = TABLE_MAX_WIDTH;
14
14
  }
15
- if (isTableAlignmentEnabled && isFullWidthModeEnabled) {
15
+ if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
16
16
  attrsOverrides.layout = 'align-start';
17
17
  }
18
18
  if (isCommentEditor && isTableResizingEnabled) {
@@ -162,7 +162,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
162
162
  }
163
163
  },
164
164
  commands: {
165
- insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions)
165
+ insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
166
166
  },
167
167
  nodes: function nodes() {
168
168
  return [{
@@ -15,7 +15,7 @@ export var createTableWithWidth = function createTableWithWidth(_ref) {
15
15
  if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
16
16
  attrsOverrides.tableWidth = TABLE_MAX_WIDTH;
17
17
  }
18
- if (isTableAlignmentEnabled && isFullWidthModeEnabled) {
18
+ if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
19
19
  attrsOverrides.layout = 'align-start';
20
20
  }
21
21
  if (isCommentEditor && isTableResizingEnabled) {
@@ -3,8 +3,9 @@ import type { HigherOrderCommand } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { TableMap } from '@atlaskit/editor-tables/table-map';
6
+ import { findTable } from '@atlaskit/editor-tables/utils';
6
7
  export declare function getSelectedTableInfo(selection: Selection): {
7
- table: import("prosemirror-utils").ContentNodeWithPos | undefined;
8
+ table: ReturnType<typeof findTable> | undefined;
8
9
  map: TableMap | undefined;
9
10
  totalRowCount: number;
10
11
  totalColumnCount: number;
@@ -3,8 +3,9 @@ import type { HigherOrderCommand } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { TableMap } from '@atlaskit/editor-tables/table-map';
6
+ import { findTable } from '@atlaskit/editor-tables/utils';
6
7
  export declare function getSelectedTableInfo(selection: Selection): {
7
- table: import("prosemirror-utils").ContentNodeWithPos | undefined;
8
+ table: ReturnType<typeof findTable> | undefined;
8
9
  map: TableMap | undefined;
9
10
  totalRowCount: number;
10
11
  totalColumnCount: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.22.0",
3
+ "version": "7.23.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,26 +30,26 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^40.3.0",
32
32
  "@atlaskit/button": "^19.1.0",
33
- "@atlaskit/custom-steps": "^0.5.0",
34
- "@atlaskit/editor-common": "^86.7.0",
33
+ "@atlaskit/custom-steps": "^0.6.0",
34
+ "@atlaskit/editor-common": "^86.8.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
- "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
- "@atlaskit/editor-plugin-analytics": "^1.5.0",
38
- "@atlaskit/editor-plugin-content-insertion": "^1.5.0",
39
- "@atlaskit/editor-plugin-editor-viewmode": "^2.0.0",
40
- "@atlaskit/editor-plugin-guideline": "^1.1.0",
41
- "@atlaskit/editor-plugin-selection": "^1.2.0",
42
- "@atlaskit/editor-plugin-width": "^1.1.0",
43
- "@atlaskit/editor-prosemirror": "4.0.1",
36
+ "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
37
+ "@atlaskit/editor-plugin-analytics": "^1.6.0",
38
+ "@atlaskit/editor-plugin-content-insertion": "^1.6.0",
39
+ "@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
40
+ "@atlaskit/editor-plugin-guideline": "^1.2.0",
41
+ "@atlaskit/editor-plugin-selection": "^1.3.0",
42
+ "@atlaskit/editor-plugin-width": "^1.2.0",
43
+ "@atlaskit/editor-prosemirror": "5.0.1",
44
44
  "@atlaskit/editor-shared-styles": "^2.13.0",
45
- "@atlaskit/editor-tables": "^2.7.0",
45
+ "@atlaskit/editor-tables": "^2.8.0",
46
46
  "@atlaskit/icon": "^22.7.0",
47
47
  "@atlaskit/menu": "^2.8.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.3.0",
49
49
  "@atlaskit/pragmatic-drag-and-drop": "^1.2.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.4.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
52
- "@atlaskit/primitives": "^11.0.0",
52
+ "@atlaskit/primitives": "^11.1.0",
53
53
  "@atlaskit/theme": "^12.11.0",
54
54
  "@atlaskit/toggle": "^13.2.0",
55
55
  "@atlaskit/tokens": "^1.56.0",
package/src/plugin.tsx CHANGED
@@ -294,6 +294,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
294
294
  options?.isTableScalingEnabled,
295
295
  options?.isTableAlignmentEnabled,
296
296
  api?.analytics?.actions,
297
+ options?.isCommentEditor,
297
298
  ),
298
299
  },
299
300
 
@@ -16,7 +16,12 @@ import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
16
16
  import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
17
17
  import { getTableWidth } from '../utils';
18
18
 
19
- export function getSelectedTableInfo(selection: Selection) {
19
+ export function getSelectedTableInfo(selection: Selection): {
20
+ table: ReturnType<typeof findTable> | undefined;
21
+ map: TableMap | undefined;
22
+ totalRowCount: number;
23
+ totalColumnCount: number;
24
+ } {
20
25
  let map;
21
26
  let totalRowCount = 0;
22
27
  let totalColumnCount = 0;
@@ -33,7 +33,7 @@ export const createTableWithWidth =
33
33
  if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
34
34
  attrsOverrides.tableWidth = TABLE_MAX_WIDTH;
35
35
  }
36
- if (isTableAlignmentEnabled && isFullWidthModeEnabled) {
36
+ if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
37
37
  attrsOverrides.layout = 'align-start';
38
38
  }
39
39
  if (isCommentEditor && isTableResizingEnabled) {