@atlaskit/editor-plugin-table 7.28.3 → 7.28.5
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 +17 -0
- package/dist/cjs/nodeviews/TableComponent.js +3 -2
- package/dist/cjs/nodeviews/table.js +2 -2
- package/dist/cjs/ui/FloatingContextualButton/index.js +2 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +3 -3
- package/dist/es2019/nodeviews/TableComponent.js +3 -2
- package/dist/es2019/nodeviews/table.js +2 -2
- package/dist/es2019/ui/FloatingContextualButton/index.js +2 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +2 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +3 -3
- package/dist/esm/nodeviews/TableComponent.js +3 -2
- package/dist/esm/nodeviews/table.js +2 -2
- package/dist/esm/ui/FloatingContextualButton/index.js +2 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +2 -1
- package/dist/esm/ui/TableFloatingControls/index.js +3 -3
- package/package.json +3 -6
- package/src/nodeviews/TableComponent.tsx +4 -3
- package/src/nodeviews/table.tsx +2 -2
- package/src/ui/FloatingContextualButton/index.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/index.tsx +4 -1
- package/src/ui/TableFloatingControls/index.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.28.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 7.28.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#146656](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146656)
|
|
14
|
+
[`2c23467e86c29`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c23467e86c29) -
|
|
15
|
+
[ux] No-issue: Set isFacadeDisabled to true for table cell dropdown
|
|
16
|
+
- [#146417](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146417)
|
|
17
|
+
[`4302239b19be5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4302239b19be5) -
|
|
18
|
+
Migrate table useSharedStateHook FF from LD to Statsig experiment.
|
|
19
|
+
|
|
3
20
|
## 7.28.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -27,6 +27,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
27
27
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
28
28
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
29
29
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
30
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
30
31
|
var _commands = require("../commands");
|
|
31
32
|
var _eventHandlers = require("../event-handlers");
|
|
32
33
|
var _utils3 = require("../pm-plugins/drag-and-drop/utils");
|
|
@@ -609,7 +610,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
609
610
|
getEditorFeatureFlags = _this$props11.getEditorFeatureFlags;
|
|
610
611
|
var isInDanger = this.props.isInDanger;
|
|
611
612
|
var table = (0, _utils2.findTable)(view.state.selection);
|
|
612
|
-
if (
|
|
613
|
+
if ((0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', false)) {
|
|
613
614
|
var pluginState = (0, _pluginFactory.getPluginState)(view.state);
|
|
614
615
|
isInDanger = pluginState.isInDanger;
|
|
615
616
|
}
|
|
@@ -753,7 +754,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
753
754
|
showBeforeShadow = _this$state3.showBeforeShadow,
|
|
754
755
|
showAfterShadow = _this$state3.showAfterShadow;
|
|
755
756
|
var node = getNode();
|
|
756
|
-
if (
|
|
757
|
+
if ((0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', false)) {
|
|
757
758
|
var pluginState = (0, _pluginFactory.getPluginState)(view.state);
|
|
758
759
|
isInDanger = pluginState.isInDanger;
|
|
759
760
|
hoveredRows = pluginState.hoveredRows;
|
|
@@ -22,7 +22,7 @@ var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
|
22
22
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
25
|
-
var
|
|
25
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
26
26
|
var _createPluginConfig = require("../create-plugin-config");
|
|
27
27
|
var _dragAndDrop = require("../pm-plugins/drag-and-drop");
|
|
28
28
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -136,7 +136,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
136
136
|
key: "render",
|
|
137
137
|
value: function render(props, forwardRef) {
|
|
138
138
|
var _this3 = this;
|
|
139
|
-
if ((0,
|
|
139
|
+
if ((0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', true)) {
|
|
140
140
|
return /*#__PURE__*/_react.default.createElement(_TableComponentWithSharedState.TableComponentWithSharedState, {
|
|
141
141
|
forwardRef: forwardRef,
|
|
142
142
|
getNode: this.getNode,
|
|
@@ -88,7 +88,8 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
88
88
|
keymap: (0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu') ? _keymaps.focusToContextMenuTrigger : undefined,
|
|
89
89
|
onClick: handleClick,
|
|
90
90
|
iconBefore: (0, _react2.jsx)(_chevronDown.default, {
|
|
91
|
-
label: ""
|
|
91
|
+
label: "",
|
|
92
|
+
isFacadeDisabled: true
|
|
92
93
|
}),
|
|
93
94
|
"aria-label": labelCellOptions,
|
|
94
95
|
"aria-expanded": (0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu') ? isContextualMenuOpen : undefined
|
|
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
12
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
13
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
14
|
var _types = require("../../types");
|
|
14
15
|
var _utils = require("../../utils");
|
|
15
16
|
var _ColumnControls = require("./ColumnControls");
|
|
@@ -104,7 +105,7 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
104
105
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
105
106
|
isDragging: isDragging,
|
|
106
107
|
getScrollOffset: getScrollOffset,
|
|
107
|
-
api: (0,
|
|
108
|
+
api: (0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', true) ? api : undefined
|
|
108
109
|
}), isDragging && /*#__PURE__*/_react.default.createElement(_ColumnDropTargets.ColumnDropTargets, {
|
|
109
110
|
tableRef: tableRef,
|
|
110
111
|
isHeaderSticky: (stickyHeader === null || stickyHeader === void 0 ? void 0 : stickyHeader.sticky) && hasHeaderRow,
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
12
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
13
|
-
var
|
|
13
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
14
|
var _commands = require("../../commands");
|
|
15
15
|
var _types = require("../../types");
|
|
16
16
|
var _nodes = require("../../utils/nodes");
|
|
@@ -108,7 +108,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
108
108
|
updateCellHoverLocation: updateCellHoverLocation,
|
|
109
109
|
stickyTop: stickyTop,
|
|
110
110
|
isDragAndDropEnabled: isDragAndDropEnabled
|
|
111
|
-
}) : null, tableActive && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, shouldShowCornerControls && ((0,
|
|
111
|
+
}) : null, tableActive && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, shouldShowCornerControls && ((0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/_react.default.createElement(_CornerControls.DragCornerControlsWithSelection, {
|
|
112
112
|
editorView: editorView,
|
|
113
113
|
tableRef: tableRef,
|
|
114
114
|
isInDanger: isInDanger,
|
|
@@ -133,7 +133,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
133
133
|
selectRow: _selectRow,
|
|
134
134
|
selectRows: _selectRows,
|
|
135
135
|
updateCellHoverLocation: updateCellHoverLocation
|
|
136
|
-
})) : (0,
|
|
136
|
+
})) : (0, _experiments.editorExperiment)('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/_react.default.createElement(_FloatingControlsWithSelection.FloatingControlsWithSelection, {
|
|
137
137
|
editorView: editorView,
|
|
138
138
|
tableRef: tableRef,
|
|
139
139
|
isInDanger: isInDanger,
|
|
@@ -13,6 +13,7 @@ import { akEditorTableNumberColumnWidth, akEditorTableToolbarSize as tableToolba
|
|
|
13
13
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
16
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
17
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
17
18
|
import { handleMouseOut, handleMouseOver, isTableInFocus, withCellTracking } from '../event-handlers';
|
|
18
19
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils';
|
|
@@ -589,7 +590,7 @@ class TableComponent extends React.Component {
|
|
|
589
590
|
isInDanger
|
|
590
591
|
} = this.props;
|
|
591
592
|
const table = findTable(view.state.selection);
|
|
592
|
-
if (
|
|
593
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
593
594
|
const pluginState = getPluginState(view.state);
|
|
594
595
|
isInDanger = pluginState.isInDanger;
|
|
595
596
|
}
|
|
@@ -733,7 +734,7 @@ class TableComponent extends React.Component {
|
|
|
733
734
|
showAfterShadow
|
|
734
735
|
} = this.state;
|
|
735
736
|
const node = getNode();
|
|
736
|
-
if (
|
|
737
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
737
738
|
const pluginState = getPluginState(view.state);
|
|
738
739
|
isInDanger = pluginState.isInDanger;
|
|
739
740
|
hoveredRows = pluginState.hoveredRows;
|
|
@@ -6,7 +6,7 @@ import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
|
6
6
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
9
|
-
import {
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
10
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
11
11
|
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
12
12
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -103,7 +103,7 @@ export default class TableView extends ReactNodeView {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
render(props, forwardRef) {
|
|
106
|
-
if (
|
|
106
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', true)) {
|
|
107
107
|
return /*#__PURE__*/React.createElement(TableComponentWithSharedState, {
|
|
108
108
|
forwardRef: forwardRef,
|
|
109
109
|
getNode: this.getNode,
|
|
@@ -85,7 +85,8 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
85
85
|
keymap: fg('platform_editor_a11y_table_context_menu') ? focusToContextMenuTrigger : undefined,
|
|
86
86
|
onClick: handleClick,
|
|
87
87
|
iconBefore: jsx(ExpandIcon, {
|
|
88
|
-
label: ""
|
|
88
|
+
label: "",
|
|
89
|
+
isFacadeDisabled: true
|
|
89
90
|
}),
|
|
90
91
|
"aria-label": labelCellOptions,
|
|
91
92
|
"aria-expanded": fg('platform_editor_a11y_table_context_menu') ? isContextualMenuOpen : undefined
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { TableCssClassName as ClassName } from '../../types';
|
|
5
6
|
import { containsHeaderColumn, getColumnsWidths, getRowHeights } from '../../utils';
|
|
6
7
|
import { ColumnControls } from './ColumnControls';
|
|
@@ -93,7 +94,7 @@ const TableFloatingColumnControls = ({
|
|
|
93
94
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
94
95
|
isDragging: isDragging,
|
|
95
96
|
getScrollOffset: getScrollOffset,
|
|
96
|
-
api:
|
|
97
|
+
api: editorExperiment('platform_editor_table_use_shared_state_hook', true) ? api : undefined
|
|
97
98
|
}), isDragging && /*#__PURE__*/React.createElement(ColumnDropTargets, {
|
|
98
99
|
tableRef: tableRef,
|
|
99
100
|
isHeaderSticky: (stickyHeader === null || stickyHeader === void 0 ? void 0 : stickyHeader.sticky) && hasHeaderRow,
|
|
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
7
7
|
import { TableCssClassName as ClassName } from '../../types';
|
|
8
8
|
import { isTableNested } from '../../utils/nodes';
|
|
@@ -106,7 +106,7 @@ export const TableFloatingControls = ({
|
|
|
106
106
|
updateCellHoverLocation: updateCellHoverLocation,
|
|
107
107
|
stickyTop: stickyTop,
|
|
108
108
|
isDragAndDropEnabled: isDragAndDropEnabled
|
|
109
|
-
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, shouldShowCornerControls && (
|
|
109
|
+
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, shouldShowCornerControls && (editorExperiment('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
|
|
110
110
|
editorView: editorView,
|
|
111
111
|
tableRef: tableRef,
|
|
112
112
|
isInDanger: isInDanger,
|
|
@@ -131,7 +131,7 @@ export const TableFloatingControls = ({
|
|
|
131
131
|
selectRow: _selectRow,
|
|
132
132
|
selectRows: _selectRows,
|
|
133
133
|
updateCellHoverLocation: updateCellHoverLocation
|
|
134
|
-
})) :
|
|
134
|
+
})) : editorExperiment('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
|
|
135
135
|
editorView: editorView,
|
|
136
136
|
tableRef: tableRef,
|
|
137
137
|
isInDanger: isInDanger,
|
|
@@ -27,6 +27,7 @@ import { akEditorTableNumberColumnWidth, akEditorTableToolbarSize as tableToolba
|
|
|
27
27
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
28
28
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
29
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
30
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
30
31
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
31
32
|
import { handleMouseOut, handleMouseOver, isTableInFocus, withCellTracking } from '../event-handlers';
|
|
32
33
|
import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils';
|
|
@@ -602,7 +603,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
602
603
|
getEditorFeatureFlags = _this$props11.getEditorFeatureFlags;
|
|
603
604
|
var isInDanger = this.props.isInDanger;
|
|
604
605
|
var table = findTable(view.state.selection);
|
|
605
|
-
if (
|
|
606
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
606
607
|
var pluginState = getPluginState(view.state);
|
|
607
608
|
isInDanger = pluginState.isInDanger;
|
|
608
609
|
}
|
|
@@ -746,7 +747,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
746
747
|
showBeforeShadow = _this$state3.showBeforeShadow,
|
|
747
748
|
showAfterShadow = _this$state3.showAfterShadow;
|
|
748
749
|
var node = getNode();
|
|
749
|
-
if (
|
|
750
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
750
751
|
var pluginState = getPluginState(view.state);
|
|
751
752
|
isInDanger = pluginState.isInDanger;
|
|
752
753
|
hoveredRows = pluginState.hoveredRows;
|
|
@@ -17,7 +17,7 @@ import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
|
17
17
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
18
18
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
19
19
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
20
|
-
import {
|
|
20
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
21
21
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
22
22
|
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
23
23
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -129,7 +129,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
129
129
|
key: "render",
|
|
130
130
|
value: function render(props, forwardRef) {
|
|
131
131
|
var _this3 = this;
|
|
132
|
-
if (
|
|
132
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', true)) {
|
|
133
133
|
return /*#__PURE__*/React.createElement(TableComponentWithSharedState, {
|
|
134
134
|
forwardRef: forwardRef,
|
|
135
135
|
getNode: this.getNode,
|
|
@@ -77,7 +77,8 @@ var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
|
77
77
|
keymap: fg('platform_editor_a11y_table_context_menu') ? focusToContextMenuTrigger : undefined,
|
|
78
78
|
onClick: handleClick,
|
|
79
79
|
iconBefore: jsx(ExpandIcon, {
|
|
80
|
-
label: ""
|
|
80
|
+
label: "",
|
|
81
|
+
isFacadeDisabled: true
|
|
81
82
|
}),
|
|
82
83
|
"aria-label": labelCellOptions,
|
|
83
84
|
"aria-expanded": fg('platform_editor_a11y_table_context_menu') ? isContextualMenuOpen : undefined
|
|
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
6
|
import { TableCssClassName as ClassName } from '../../types';
|
|
6
7
|
import { containsHeaderColumn, getColumnsWidths, getRowHeights } from '../../utils';
|
|
7
8
|
import { ColumnControls } from './ColumnControls';
|
|
@@ -94,7 +95,7 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
94
95
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
95
96
|
isDragging: isDragging,
|
|
96
97
|
getScrollOffset: getScrollOffset,
|
|
97
|
-
api:
|
|
98
|
+
api: editorExperiment('platform_editor_table_use_shared_state_hook', true) ? api : undefined
|
|
98
99
|
}), isDragging && /*#__PURE__*/React.createElement(ColumnDropTargets, {
|
|
99
100
|
tableRef: tableRef,
|
|
100
101
|
isHeaderSticky: (stickyHeader === null || stickyHeader === void 0 ? void 0 : stickyHeader.sticky) && hasHeaderRow,
|
|
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
7
7
|
import { TableCssClassName as ClassName } from '../../types';
|
|
8
8
|
import { isTableNested } from '../../utils/nodes';
|
|
@@ -98,7 +98,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
|
98
98
|
updateCellHoverLocation: updateCellHoverLocation,
|
|
99
99
|
stickyTop: stickyTop,
|
|
100
100
|
isDragAndDropEnabled: isDragAndDropEnabled
|
|
101
|
-
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, shouldShowCornerControls && (
|
|
101
|
+
}) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(React.Fragment, null, shouldShowCornerControls && (editorExperiment('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/React.createElement(DragCornerControlsWithSelection, {
|
|
102
102
|
editorView: editorView,
|
|
103
103
|
tableRef: tableRef,
|
|
104
104
|
isInDanger: isInDanger,
|
|
@@ -123,7 +123,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
|
123
123
|
selectRow: _selectRow,
|
|
124
124
|
selectRows: _selectRows,
|
|
125
125
|
updateCellHoverLocation: updateCellHoverLocation
|
|
126
|
-
})) :
|
|
126
|
+
})) : editorExperiment('platform_editor_table_use_shared_state_hook', true) ? /*#__PURE__*/React.createElement(FloatingControlsWithSelection, {
|
|
127
127
|
editorView: editorView,
|
|
128
128
|
tableRef: tableRef,
|
|
129
129
|
isInDanger: isInDanger,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.28.
|
|
3
|
+
"version": "7.28.5",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
31
31
|
"@atlaskit/button": "^20.2.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
33
|
-
"@atlaskit/editor-common": "^
|
|
33
|
+
"@atlaskit/editor-common": "^92.0.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.1",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
37
|
-
"@atlaskit/editor-plugin-batch-attribute-updates": "1.0.
|
|
37
|
+
"@atlaskit/editor-plugin-batch-attribute-updates": "1.0.7",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^1.8.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-guideline": "^1.2.0",
|
|
@@ -103,9 +103,6 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"platform-feature-flags": {
|
|
106
|
-
"platform.editor.table.use-shared-state-hook": {
|
|
107
|
-
"type": "boolean"
|
|
108
|
-
},
|
|
109
106
|
"platform_editor_batch_steps_table": {
|
|
110
107
|
"type": "boolean"
|
|
111
108
|
},
|
|
@@ -26,6 +26,7 @@ import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
|
26
26
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
27
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
28
28
|
import type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';
|
|
29
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
29
30
|
import { token } from '@atlaskit/tokens';
|
|
30
31
|
|
|
31
32
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
@@ -117,7 +118,7 @@ interface ComponentProps {
|
|
|
117
118
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
118
119
|
intl: IntlShape;
|
|
119
120
|
|
|
120
|
-
// marking props as option to ensure backward compatibility when
|
|
121
|
+
// marking props as option to ensure backward compatibility when platform_editor_table_use_shared_state_hook disabled
|
|
121
122
|
isInDanger?: boolean;
|
|
122
123
|
hoveredRows?: number[];
|
|
123
124
|
hoveredCell?: CellHoverMeta;
|
|
@@ -536,7 +537,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
536
537
|
|
|
537
538
|
const table = findTable(view.state.selection);
|
|
538
539
|
|
|
539
|
-
if (
|
|
540
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
540
541
|
const pluginState = getPluginState(view.state);
|
|
541
542
|
isInDanger = pluginState.isInDanger;
|
|
542
543
|
}
|
|
@@ -749,7 +750,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
749
750
|
const { showBeforeShadow, showAfterShadow } = this.state;
|
|
750
751
|
const node = getNode();
|
|
751
752
|
|
|
752
|
-
if (
|
|
753
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
|
|
753
754
|
const pluginState = getPluginState(view.state);
|
|
754
755
|
isInDanger = pluginState.isInDanger;
|
|
755
756
|
hoveredRows = pluginState.hoveredRows;
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -19,7 +19,7 @@ import type { EditorState, PluginKey } from '@atlaskit/editor-prosemirror/state'
|
|
|
19
19
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
20
20
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
21
21
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
22
|
-
import {
|
|
22
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
23
23
|
|
|
24
24
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
25
25
|
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
@@ -182,7 +182,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
render(props: Props, forwardRef: ForwardRef) {
|
|
185
|
-
if (
|
|
185
|
+
if (editorExperiment('platform_editor_table_use_shared_state_hook', true)) {
|
|
186
186
|
return (
|
|
187
187
|
<TableComponentWithSharedState
|
|
188
188
|
forwardRef={forwardRef}
|
|
@@ -110,7 +110,7 @@ const FloatingContextualButtonInner = React.memo((props: Props & WrappedComponen
|
|
|
110
110
|
fg('platform_editor_a11y_table_context_menu') ? focusToContextMenuTrigger : undefined
|
|
111
111
|
}
|
|
112
112
|
onClick={handleClick}
|
|
113
|
-
iconBefore={<ExpandIcon label="" />}
|
|
113
|
+
iconBefore={<ExpandIcon label="" isFacadeDisabled={true} />}
|
|
114
114
|
aria-label={labelCellOptions}
|
|
115
115
|
aria-expanded={
|
|
116
116
|
fg('platform_editor_a11y_table_context_menu') ? isContextualMenuOpen : undefined
|
|
@@ -7,6 +7,7 @@ import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
10
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
|
|
11
12
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
12
13
|
import type { CellHoverMeta, DraggableSourceData, PluginInjectionAPI } from '../../types';
|
|
@@ -136,7 +137,9 @@ const TableFloatingColumnControls = ({
|
|
|
136
137
|
isNumberColumnEnabled={isNumberColumnEnabled}
|
|
137
138
|
isDragging={isDragging}
|
|
138
139
|
getScrollOffset={getScrollOffset}
|
|
139
|
-
api={
|
|
140
|
+
api={
|
|
141
|
+
editorExperiment('platform_editor_table_use_shared_state_hook', true) ? api : undefined
|
|
142
|
+
}
|
|
140
143
|
/>
|
|
141
144
|
{isDragging && (
|
|
142
145
|
<ColumnDropTargets
|
|
@@ -8,7 +8,7 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
8
8
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
11
|
-
import {
|
|
11
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
12
|
|
|
13
13
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../commands';
|
|
14
14
|
import type { TablePlugin } from '../../plugin';
|
|
@@ -163,7 +163,7 @@ export const TableFloatingControls = ({
|
|
|
163
163
|
{isDragAndDropEnabled ? (
|
|
164
164
|
<>
|
|
165
165
|
{shouldShowCornerControls &&
|
|
166
|
-
(
|
|
166
|
+
(editorExperiment('platform_editor_table_use_shared_state_hook', true) ? (
|
|
167
167
|
<DragCornerControlsWithSelection
|
|
168
168
|
editorView={editorView}
|
|
169
169
|
tableRef={tableRef}
|
|
@@ -195,7 +195,7 @@ export const TableFloatingControls = ({
|
|
|
195
195
|
updateCellHoverLocation={updateCellHoverLocation}
|
|
196
196
|
/>
|
|
197
197
|
</>
|
|
198
|
-
) :
|
|
198
|
+
) : editorExperiment('platform_editor_table_use_shared_state_hook', true) ? (
|
|
199
199
|
<FloatingControlsWithSelection
|
|
200
200
|
editorView={editorView}
|
|
201
201
|
tableRef={tableRef}
|