@atlaskit/editor-plugin-table 18.1.18 → 18.1.20

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,21 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 18.1.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [`91f722df43475`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/91f722df43475) -
8
+ [ux] [EDITOR-5815] the fix adds a check for column width changes so that we update the table on
9
+ click of 'distribute columns' button. this is gated behind the
10
+ `platform_editor_lovability_distribute_column_fix` experiment.
11
+ - Updated dependencies
12
+
13
+ ## 18.1.19
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 18.1.18
4
20
 
5
21
  ### Patch Changes
@@ -21,6 +21,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
21
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
22
  var _tableMap = require("@atlaskit/editor-tables/table-map");
23
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
24
25
  var _createPluginConfig = require("../pm-plugins/create-plugin-config");
25
26
  var _pluginFactory = require("../pm-plugins/plugin-factory");
26
27
  var _tableWidth = require("../pm-plugins/table-width");
@@ -263,6 +264,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
263
264
  if ((0, _typeof2.default)(node.attrs) !== (0, _typeof2.default)(nextNode.attrs)) {
264
265
  return true;
265
266
  }
267
+ if ((0, _nodes.tablesHaveDifferentColumnWidths)(node, nextNode) && (0, _expValEquals.expValEquals)('platform_editor_lovability_distribute_column_fix', 'isEnabled', true)) {
268
+ return true;
269
+ }
266
270
  var attrKeys = Object.keys(node.attrs);
267
271
  var nextAttrKeys = Object.keys(nextNode.attrs);
268
272
  if (attrKeys.length !== nextAttrKeys.length) {
@@ -787,7 +787,6 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
787
787
  }, (0, _react2.jsx)("div", {
788
788
  "data-testid": "table-cell-contextual-menu",
789
789
  onMouseLeave: (0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? undefined : this.closeSubmenu,
790
- onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
791
790
  ref: this.dropdownMenuRef
792
791
  }, (0, _react2.jsx)(_uiMenu.DropdownMenu
793
792
  //This needs be removed when the a11y is completely handled
@@ -7,10 +7,11 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
8
8
  import { TableMap } from '@atlaskit/editor-tables/table-map';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
11
12
  import { getPluginState } from '../pm-plugins/plugin-factory';
12
13
  import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
13
- import { isTableNested } from '../pm-plugins/utils/nodes';
14
+ import { isTableNested, tablesHaveDifferentColumnWidths } from '../pm-plugins/utils/nodes';
14
15
  import { TableComponentWithSharedState } from './TableComponentWithSharedState';
15
16
  import { tableNodeSpecWithFixedToDOM } from './toDOM';
16
17
  const tableAttributes = node => {
@@ -228,6 +229,9 @@ export default class TableView extends ReactNodeView {
228
229
  if (typeof node.attrs !== typeof nextNode.attrs) {
229
230
  return true;
230
231
  }
232
+ if (tablesHaveDifferentColumnWidths(node, nextNode) && expValEquals('platform_editor_lovability_distribute_column_fix', 'isEnabled', true)) {
233
+ return true;
234
+ }
231
235
  const attrKeys = Object.keys(node.attrs);
232
236
  const nextAttrKeys = Object.keys(nextNode.attrs);
233
237
  if (attrKeys.length !== nextAttrKeys.length) {
@@ -843,7 +843,6 @@ export class ContextualMenu extends Component {
843
843
  }, jsx("div", {
844
844
  "data-testid": "table-cell-contextual-menu",
845
845
  onMouseLeave: expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? undefined : this.closeSubmenu,
846
- onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
847
846
  ref: this.dropdownMenuRef
848
847
  }, jsx(DropdownMenu
849
848
  //This needs be removed when the a11y is completely handled
@@ -17,10 +17,11 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
17
17
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
18
18
  import { TableMap } from '@atlaskit/editor-tables/table-map';
19
19
  import { fg } from '@atlaskit/platform-feature-flags';
20
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
21
  import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
21
22
  import { getPluginState } from '../pm-plugins/plugin-factory';
22
23
  import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
23
- import { isTableNested } from '../pm-plugins/utils/nodes';
24
+ import { isTableNested, tablesHaveDifferentColumnWidths } from '../pm-plugins/utils/nodes';
24
25
  import { TableComponentWithSharedState } from './TableComponentWithSharedState';
25
26
  import { tableNodeSpecWithFixedToDOM } from './toDOM';
26
27
  var tableAttributes = function tableAttributes(node) {
@@ -256,6 +257,9 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
256
257
  if (_typeof(node.attrs) !== _typeof(nextNode.attrs)) {
257
258
  return true;
258
259
  }
260
+ if (tablesHaveDifferentColumnWidths(node, nextNode) && expValEquals('platform_editor_lovability_distribute_column_fix', 'isEnabled', true)) {
261
+ return true;
262
+ }
259
263
  var attrKeys = Object.keys(node.attrs);
260
264
  var nextAttrKeys = Object.keys(nextNode.attrs);
261
265
  if (attrKeys.length !== nextAttrKeys.length) {
@@ -781,7 +781,6 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
781
781
  }, jsx("div", {
782
782
  "data-testid": "table-cell-contextual-menu",
783
783
  onMouseLeave: expValEquals('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? undefined : this.closeSubmenu,
784
- onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
785
784
  ref: this.dropdownMenuRef
786
785
  }, jsx(DropdownMenu
787
786
  //This needs be removed when the a11y is completely handled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "18.1.18",
3
+ "version": "18.1.20",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^8.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^8.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^10.0.0",
40
- "@atlaskit/editor-plugin-extension": "11.0.21",
40
+ "@atlaskit/editor-plugin-extension": "11.0.22",
41
41
  "@atlaskit/editor-plugin-guideline": "^8.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^15.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^5.0.0",
@@ -56,10 +56,10 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^18.1.0",
59
- "@atlaskit/tmp-editor-statsig": "^51.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^52.1.0",
60
60
  "@atlaskit/toggle": "^15.2.0",
61
61
  "@atlaskit/tokens": "^11.4.0",
62
- "@atlaskit/tooltip": "^21.0.0",
62
+ "@atlaskit/tooltip": "^21.1.0",
63
63
  "@babel/runtime": "^7.0.0",
64
64
  "@emotion/react": "^11.7.1",
65
65
  "classnames": "^2.2.5",
@@ -69,7 +69,7 @@
69
69
  "uuid": "^3.1.0"
70
70
  },
71
71
  "peerDependencies": {
72
- "@atlaskit/editor-common": "^112.13.0",
72
+ "@atlaskit/editor-common": "^112.15.0",
73
73
  "react": "^18.2.0",
74
74
  "react-dom": "^18.2.0",
75
75
  "react-intl-next": "npm:react-intl@^5.18.1"