@atlaskit/editor-plugin-table 16.1.6 → 16.1.7

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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 16.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`acd81a73a9a20`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acd81a73a9a20) -
8
+ [ux] EDITOR-4259 Set table ref when table is rendered
9
+ - Updated dependencies
10
+
3
11
  ## 16.1.6
4
12
 
5
13
  ### Patch Changes
@@ -926,6 +926,12 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
926
926
  if (tableElement !== _this5.table) {
927
927
  _this5.table = tableElement;
928
928
  _this5.observeTable(_this5.table);
929
+
930
+ // // Update tableRef in plugin state when table is properly mounted
931
+ // // At this point, both table and wrapper are in DOM with correct parent-child relationship
932
+ if (_this5.table && _this5.props.view && (0, _expValEquals.expValEquals)('platform_editor_table_update_table_ref', 'isEnabled', true)) {
933
+ (0, _commands.setTableRef)(_this5.table)(_this5.props.view.state, _this5.props.view.dispatch);
934
+ }
929
935
  }
930
936
  }
931
937
  }
@@ -13,7 +13,7 @@ import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
13
13
  import { isTableSelected } from '@atlaskit/editor-tables/utils';
14
14
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
15
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
- import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
16
+ import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/commands';
17
17
  import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
18
18
  import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers/plugin-key';
19
19
  import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
@@ -891,6 +891,12 @@ class TableComponent extends React.Component {
891
891
  if (tableElement !== this.table) {
892
892
  this.table = tableElement;
893
893
  this.observeTable(this.table);
894
+
895
+ // // Update tableRef in plugin state when table is properly mounted
896
+ // // At this point, both table and wrapper are in DOM with correct parent-child relationship
897
+ if (this.table && this.props.view && expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true)) {
898
+ setTableRef(this.table)(this.props.view.state, this.props.view.dispatch);
899
+ }
894
900
  }
895
901
  }
896
902
  }
@@ -26,7 +26,7 @@ import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
26
26
  import { isTableSelected } from '@atlaskit/editor-tables/utils';
27
27
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
28
28
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
29
- import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
29
+ import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/commands';
30
30
  import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
31
31
  import { pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers/plugin-key';
32
32
  import { findStickyHeaderForTable } from '../pm-plugins/sticky-headers/util';
@@ -920,6 +920,12 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
920
920
  if (tableElement !== _this5.table) {
921
921
  _this5.table = tableElement;
922
922
  _this5.observeTable(_this5.table);
923
+
924
+ // // Update tableRef in plugin state when table is properly mounted
925
+ // // At this point, both table and wrapper are in DOM with correct parent-child relationship
926
+ if (_this5.table && _this5.props.view && expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true)) {
927
+ setTableRef(_this5.table)(_this5.props.view.state, _this5.props.view.dispatch);
928
+ }
923
929
  }
924
930
  }
925
931
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "16.1.6",
3
+ "version": "16.1.7",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^17.0.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^16.9.0",
60
+ "@atlaskit/tmp-editor-statsig": "^16.10.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
62
  "@atlaskit/tokens": "^9.1.0",
63
63
  "@atlaskit/tooltip": "^20.12.0",