@atlaskit/editor-plugin-table 12.1.12 → 12.1.14

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,19 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 12.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 12.1.13
10
+
11
+ ### Patch Changes
12
+
13
+ - [`88b2a10575ae6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88b2a10575ae6) -
14
+ fix a bug that incorrectly calculate col width with nested tables
15
+ - Updated dependencies
16
+
3
17
  ## 12.1.12
4
18
 
5
19
  ### Patch Changes
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
10
10
  var _styles = require("@atlaskit/editor-common/styles");
11
11
  var _utils = require("@atlaskit/editor-common/utils");
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  var _analytics = require("../../utils/analytics");
13
14
  var _colgroup = require("./colgroup");
14
15
  var _columnState = require("./column-state");
@@ -101,7 +102,7 @@ var getResizeState = exports.getResizeState = function getResizeState(_ref) {
101
102
 
102
103
  // updates Colgroup DOM node with new widths
103
104
  var updateColgroup = exports.updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent) {
104
- var cols = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
105
+ var cols = (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) ? tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll(':scope > colgroup > col') : tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
105
106
  var columnsCount = cols === null || cols === void 0 ? void 0 : cols.length;
106
107
  /**
107
108
  updateColgroup will update whole table scale when click the column resize handle, this behavior will affect when table overflowed, when now resize handle been dragged and extend to make table overflowed, table will show overflow. This need to be confirmed because it conflict with how isTableScalingEnabled work.
@@ -1,6 +1,7 @@
1
1
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
2
2
  import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  import { getSelectedTableInfo } from '../../utils/analytics';
5
6
  import { getColWidthFix, hasTableBeenResized, insertColgroupFromNode } from './colgroup';
6
7
  import { getCellsRefsInColumn, getColumnStateFromDOM } from './column-state';
@@ -79,7 +80,7 @@ export const getResizeState = ({
79
80
 
80
81
  // updates Colgroup DOM node with new widths
81
82
  export const updateColgroup = (state, tableRef, tableNode, isTableScalingEnabled, scalePercent) => {
82
- const cols = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
83
+ const cols = expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll(':scope > colgroup > col') : tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
83
84
  const columnsCount = cols === null || cols === void 0 ? void 0 : cols.length;
84
85
  /**
85
86
  updateColgroup will update whole table scale when click the column resize handle, this behavior will affect when table overflowed, when now resize handle been dragged and extend to make table overflowed, table will show overflow. This need to be confirmed because it conflict with how isTableScalingEnabled work.
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
5
5
  import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
6
6
  import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
7
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
8
  import { getSelectedTableInfo } from '../../utils/analytics';
8
9
  import { getColWidthFix, hasTableBeenResized, insertColgroupFromNode } from './colgroup';
9
10
  import { getCellsRefsInColumn, getColumnStateFromDOM } from './column-state';
@@ -94,7 +95,7 @@ export var getResizeState = function getResizeState(_ref) {
94
95
 
95
96
  // updates Colgroup DOM node with new widths
96
97
  export var updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent) {
97
- var cols = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
98
+ var cols = expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true) ? tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll(':scope > colgroup > col') : tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
98
99
  var columnsCount = cols === null || cols === void 0 ? void 0 : cols.length;
99
100
  /**
100
101
  updateColgroup will update whole table scale when click the column resize handle, this behavior will affect when table overflowed, when now resize handle been dragged and extend to make table overflowed, table will show overflow. This need to be confirmed because it conflict with how isTableScalingEnabled work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "12.1.12",
3
+ "version": "12.1.14",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,24 +37,24 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^3.1.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
40
- "@atlaskit/editor-plugin-extension": "6.1.5",
40
+ "@atlaskit/editor-plugin-extension": "6.1.6",
41
41
  "@atlaskit/editor-plugin-guideline": "^3.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^5.0.0",
43
43
  "@atlaskit/editor-plugin-selection": "^3.0.0",
44
44
  "@atlaskit/editor-plugin-width": "^4.0.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
- "@atlaskit/editor-shared-styles": "^3.5.0",
46
+ "@atlaskit/editor-shared-styles": "^3.6.0",
47
47
  "@atlaskit/editor-tables": "^2.9.0",
48
- "@atlaskit/icon": "^27.9.0",
48
+ "@atlaskit/icon": "^27.10.0",
49
49
  "@atlaskit/menu": "^8.1.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
51
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
52
52
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
54
54
  "@atlaskit/primitives": "^14.11.0",
55
- "@atlaskit/react-ufo": "^4.1.0",
55
+ "@atlaskit/react-ufo": "^4.2.0",
56
56
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.24.0",
57
+ "@atlaskit/tmp-editor-statsig": "^9.26.0",
58
58
  "@atlaskit/toggle": "^15.1.0",
59
59
  "@atlaskit/tokens": "^6.0.0",
60
60
  "@atlaskit/tooltip": "^20.4.0",
@@ -67,14 +67,11 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^107.17.0",
70
+ "@atlaskit/editor-common": "^107.20.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl-next": "npm:react-intl@^5.18.1"
74
74
  },
75
- "devDependencies": {
76
- "typescript": "~5.4.2"
77
- },
78
75
  "af:exports": {
79
76
  "./types": "./src/types/index.ts",
80
77
  ".": "./src/index.ts",
@@ -5,6 +5,7 @@ import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
5
5
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
6
6
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { Rect } from '@atlaskit/editor-tables/table-map';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
 
9
10
  import { getSelectedTableInfo } from '../../utils/analytics';
10
11
 
@@ -118,7 +119,9 @@ export const updateColgroup = (
118
119
  isTableScalingEnabled?: boolean,
119
120
  scalePercent?: number,
120
121
  ): void => {
121
- const cols = tableRef?.querySelectorAll('col');
122
+ const cols = expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)
123
+ ? (tableRef?.querySelectorAll(':scope > colgroup > col') as NodeListOf<HTMLElement> | undefined)
124
+ : (tableRef?.querySelectorAll('col') as NodeListOf<HTMLElement> | undefined);
122
125
  const columnsCount = cols?.length;
123
126
  /**
124
127
  updateColgroup will update whole table scale when click the column resize handle, this behavior will affect when table overflowed, when now resize handle been dragged and extend to make table overflowed, table will show overflow. This need to be confirmed because it conflict with how isTableScalingEnabled work.