@atlaskit/editor-plugin-table 11.0.2 → 11.1.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 +21 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/nodeviews/TableComponent.js +57 -3
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +52 -38
- package/dist/cjs/nodeviews/TableContainer.js +39 -24
- package/dist/cjs/nodeviews/TableResizer.js +13 -8
- package/dist/cjs/tablePlugin.js +9 -4
- package/dist/cjs/ui/DragHandle/index.js +11 -5
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +9 -4
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +10 -5
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +10 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +10 -5
- package/dist/cjs/ui/global-styles.js +9 -4
- package/dist/cjs/ui/icons/SortingIconWrapper.js +9 -4
- package/dist/es2019/nodeviews/TableComponent.js +52 -2
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +47 -32
- package/dist/es2019/nodeviews/TableContainer.js +33 -18
- package/dist/es2019/nodeviews/TableResizer.js +14 -8
- package/dist/es2019/tablePlugin.js +9 -3
- package/dist/es2019/ui/DragHandle/index.js +11 -4
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +9 -3
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +10 -4
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +10 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +10 -4
- package/dist/es2019/ui/global-styles.js +9 -3
- package/dist/es2019/ui/icons/SortingIconWrapper.js +9 -3
- package/dist/esm/nodeviews/TableComponent.js +57 -2
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +53 -39
- package/dist/esm/nodeviews/TableContainer.js +40 -25
- package/dist/esm/nodeviews/TableResizer.js +14 -9
- package/dist/esm/tablePlugin.js +10 -5
- package/dist/esm/ui/DragHandle/index.js +12 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +10 -5
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +11 -6
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +11 -6
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +11 -6
- package/dist/esm/ui/global-styles.js +10 -5
- package/dist/esm/ui/icons/SortingIconWrapper.js +10 -5
- package/dist/types/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +4 -0
- package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/package.json +6 -5
- package/src/nodeviews/TableComponent.tsx +57 -0
- package/src/nodeviews/TableComponentWithSharedState.tsx +62 -32
- package/src/nodeviews/TableContainer.tsx +40 -25
- package/src/nodeviews/TableResizer.tsx +10 -7
- package/src/tablePlugin.tsx +4 -2
- package/src/ui/DragHandle/index.tsx +9 -3
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +5 -3
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +5 -3
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +5 -3
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +5 -3
- package/src/ui/global-styles.tsx +4 -2
- package/src/ui/icons/SortingIconWrapper.tsx +4 -2
- package/tsconfig.app.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 11.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#184563](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/184563)
|
|
8
|
+
[`d5b7a19b7e9ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d5b7a19b7e9ad) -
|
|
9
|
+
Adds UFO holds to the table component on load
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#183428](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183428)
|
|
14
|
+
[`acba3dd7b2daa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acba3dd7b2daa) -
|
|
15
|
+
Migrate table to useSharedPluginStateWithSelector
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 11.0.3
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 11.0.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -4,7 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports._reset_tableComponentCount = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -28,6 +29,8 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
28
29
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
29
30
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
31
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
32
|
+
var _loadHold = _interopRequireDefault(require("@atlaskit/react-ufo/load-hold"));
|
|
33
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
31
34
|
var _commands = require("../pm-plugins/commands");
|
|
32
35
|
var _autoscrollers = require("../pm-plugins/drag-and-drop/utils/autoscrollers");
|
|
33
36
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -73,6 +76,14 @@ var isOverflowAnalyticsEnabled = false;
|
|
|
73
76
|
// Prevent unnecessary parentWidth updates when table is nested inside of a node that is nested itself.
|
|
74
77
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MIN_THRESHOLD = 2;
|
|
75
78
|
var NESTED_TABLE_IN_NESTED_PARENT_WIDTH_DIFF_MAX_THRESHOLD = 20;
|
|
79
|
+
var _tableComponentCount = 1;
|
|
80
|
+
/**
|
|
81
|
+
* Exported for test purposes only
|
|
82
|
+
*/
|
|
83
|
+
var _reset_tableComponentCount = exports._reset_tableComponentCount = function _reset_tableComponentCount() {
|
|
84
|
+
return _tableComponentCount = 0;
|
|
85
|
+
};
|
|
86
|
+
|
|
76
87
|
// Ignored via go/ees005
|
|
77
88
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
78
89
|
var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
@@ -84,6 +95,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
84
95
|
scroll: 0,
|
|
85
96
|
parentWidth: undefined
|
|
86
97
|
}, _types.ShadowEvent.SHOW_BEFORE_SHADOW, false), _types.ShadowEvent.SHOW_AFTER_SHADOW, false), "tableWrapperWidth", undefined), "tableWrapperHeight", undefined));
|
|
98
|
+
(0, _defineProperty3.default)(_this, "holdCompleted", false);
|
|
99
|
+
(0, _defineProperty3.default)(_this, "dispatchEventName", "tableResized-".concat(_tableComponentCount++));
|
|
87
100
|
(0, _defineProperty3.default)(_this, "handleMouseOut", function (event) {
|
|
88
101
|
if (!(0, _eventHandlers.isTableInFocus)(_this.props.view)) {
|
|
89
102
|
return false;
|
|
@@ -706,6 +719,14 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
706
719
|
// Ignored via go/ees005
|
|
707
720
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
708
721
|
_this4.table, tableNode, shouldScaleOnColgroupUpdate, scalePercent);
|
|
722
|
+
if ((0, _expValEquals.expValEquals)('cc_editor_ufo_hold_table_till_resize_complete', 'isEnabled', true)) {
|
|
723
|
+
// Mark table as updated for TableHold component (if no table exists yet, the colgroup update will not have done anything)
|
|
724
|
+
if (_this4.table && !_this4.holdCompleted) {
|
|
725
|
+
var customTableResizedEvent = new CustomEvent(_this4.dispatchEventName);
|
|
726
|
+
document.dispatchEvent(customTableResizedEvent);
|
|
727
|
+
_this4.holdCompleted = true;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
709
730
|
});
|
|
710
731
|
}
|
|
711
732
|
}
|
|
@@ -1000,7 +1021,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1000
1021
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
1001
1022
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
1002
1023
|
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor
|
|
1003
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
1024
|
+
}, (0, _expValEquals.expValEquals)('cc_editor_ufo_hold_table_till_resize_complete', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(TableHold, {
|
|
1025
|
+
dispatchEventName: this.dispatchEventName
|
|
1026
|
+
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1004
1027
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1005
1028
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
1006
1029
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1136,4 +1159,35 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1136
1159
|
}]);
|
|
1137
1160
|
}(_react.default.Component);
|
|
1138
1161
|
(0, _defineProperty3.default)(TableComponent, "displayName", 'TableComponent');
|
|
1139
|
-
var _default = exports.default = (0, _reactIntlNext.injectIntl)(TableComponent);
|
|
1162
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(TableComponent);
|
|
1163
|
+
/**
|
|
1164
|
+
* This is needed because of how currently the table is resized post client boot up with code that exists outside react
|
|
1165
|
+
*
|
|
1166
|
+
* This can be deleted once https://home.atlassian.com/o/2346a038-3c8c-498b-a79b-e7847859868d/s/a436116f-02ce-4520-8fbb-7301462a1674/project/ATLAS-97756/updates
|
|
1167
|
+
* is rolled out (and doesn't need to be used in the test arm of that change).
|
|
1168
|
+
*/
|
|
1169
|
+
var TableHold = /*#__PURE__*/_react.default.memo(function TableHold(_ref) {
|
|
1170
|
+
var dispatchEventName = _ref.dispatchEventName;
|
|
1171
|
+
var _React$useState = _react.default.useState(false),
|
|
1172
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
1173
|
+
tableUpdateConfirmed = _React$useState2[0],
|
|
1174
|
+
setTableUpdateConfirmed = _React$useState2[1];
|
|
1175
|
+
_react.default.useEffect(function () {
|
|
1176
|
+
var customEventListener = function customEventListener() {
|
|
1177
|
+
setTableUpdateConfirmed(true);
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1181
|
+
document.addEventListener(dispatchEventName, customEventListener);
|
|
1182
|
+
return function () {
|
|
1183
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
1184
|
+
document.removeEventListener(dispatchEventName, customEventListener);
|
|
1185
|
+
};
|
|
1186
|
+
}, [dispatchEventName]);
|
|
1187
|
+
if (tableUpdateConfirmed === false) {
|
|
1188
|
+
return /*#__PURE__*/_react.default.createElement(_loadHold.default, {
|
|
1189
|
+
name: "editor_table_resize"
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
return null;
|
|
1193
|
+
});
|
|
@@ -7,44 +7,58 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TableComponentWithSharedState = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
10
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
12
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
|
-
var _useInternalTablePluginStateSelector = require("../ui/hooks/useInternalTablePluginStateSelector");
|
|
14
12
|
var _TableComponent = _interopRequireDefault(require("./TableComponent"));
|
|
15
13
|
// Ignored via go/ees005
|
|
16
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
15
|
|
|
18
16
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
17
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table', 'width', 'media', 'selection', 'editorViewMode', 'interaction'], function (states) {
|
|
18
|
+
var _states$tableState, _states$tableState2, _states$tableState3, _states$tableState4, _states$tableState5, _states$tableState6, _states$tableState7, _states$tableState8, _states$tableState9, _states$tableState0, _states$tableState1, _states$mediaState, _states$selectionStat, _states$editorViewMod, _states$widthState, _states$widthState2, _states$interactionSt;
|
|
19
|
+
return {
|
|
20
|
+
// tableState
|
|
21
|
+
isTableResizing: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.isTableResizing,
|
|
22
|
+
isHeaderColumnEnabled: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.isHeaderColumnEnabled,
|
|
23
|
+
isHeaderRowEnabled: (_states$tableState3 = states.tableState) === null || _states$tableState3 === void 0 ? void 0 : _states$tableState3.isHeaderRowEnabled,
|
|
24
|
+
ordering: (_states$tableState4 = states.tableState) === null || _states$tableState4 === void 0 ? void 0 : _states$tableState4.ordering,
|
|
25
|
+
isResizing: (_states$tableState5 = states.tableState) === null || _states$tableState5 === void 0 ? void 0 : _states$tableState5.isResizing,
|
|
26
|
+
isInDanger: (_states$tableState6 = states.tableState) === null || _states$tableState6 === void 0 ? void 0 : _states$tableState6.isInDanger,
|
|
27
|
+
hoveredCell: (_states$tableState7 = states.tableState) === null || _states$tableState7 === void 0 ? void 0 : _states$tableState7.hoveredCell,
|
|
28
|
+
hoveredRows: (_states$tableState8 = states.tableState) === null || _states$tableState8 === void 0 ? void 0 : _states$tableState8.hoveredRows,
|
|
29
|
+
isTableHovered: (_states$tableState9 = states.tableState) === null || _states$tableState9 === void 0 ? void 0 : _states$tableState9.isTableHovered,
|
|
30
|
+
isWholeTableInDanger: (_states$tableState0 = states.tableState) === null || _states$tableState0 === void 0 ? void 0 : _states$tableState0.isWholeTableInDanger,
|
|
31
|
+
// Required so that table control re-renders
|
|
32
|
+
targetCellPosition: (_states$tableState1 = states.tableState) === null || _states$tableState1 === void 0 ? void 0 : _states$tableState1.targetCellPosition,
|
|
33
|
+
// mediaState
|
|
34
|
+
isFullscreen: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.isFullscreen,
|
|
35
|
+
// selectionState
|
|
36
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection,
|
|
37
|
+
// editorViewModeState
|
|
38
|
+
mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode,
|
|
39
|
+
// widthState
|
|
40
|
+
width: (_states$widthState = states.widthState) === null || _states$widthState === void 0 ? void 0 : _states$widthState.width,
|
|
41
|
+
lineLength: (_states$widthState2 = states.widthState) === null || _states$widthState2 === void 0 ? void 0 : _states$widthState2.lineLength,
|
|
42
|
+
// interactionState
|
|
43
|
+
interaction: (_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
isTableResizing = _useSharedPluginState.isTableResizing,
|
|
47
|
+
isHeaderColumnEnabled = _useSharedPluginState.isHeaderColumnEnabled,
|
|
48
|
+
isHeaderRowEnabled = _useSharedPluginState.isHeaderRowEnabled,
|
|
49
|
+
ordering = _useSharedPluginState.ordering,
|
|
50
|
+
isResizing = _useSharedPluginState.isResizing,
|
|
51
|
+
isInDanger = _useSharedPluginState.isInDanger,
|
|
52
|
+
hoveredCell = _useSharedPluginState.hoveredCell,
|
|
53
|
+
hoveredRows = _useSharedPluginState.hoveredRows,
|
|
54
|
+
isTableHovered = _useSharedPluginState.isTableHovered,
|
|
55
|
+
isWholeTableInDanger = _useSharedPluginState.isWholeTableInDanger,
|
|
56
|
+
interaction = _useSharedPluginState.interaction,
|
|
57
|
+
isFullscreen = _useSharedPluginState.isFullscreen,
|
|
58
|
+
lineLength = _useSharedPluginState.lineLength,
|
|
59
|
+
mode = _useSharedPluginState.mode,
|
|
60
|
+
selection = _useSharedPluginState.selection,
|
|
61
|
+
width = _useSharedPluginState.width;
|
|
48
62
|
return {
|
|
49
63
|
tableState: undefined,
|
|
50
64
|
widthState: undefined,
|
|
@@ -66,13 +80,13 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
66
80
|
interaction: interaction
|
|
67
81
|
};
|
|
68
82
|
}, function (api) {
|
|
69
|
-
var
|
|
70
|
-
widthState =
|
|
71
|
-
tableState =
|
|
72
|
-
mediaState =
|
|
73
|
-
selectionState =
|
|
74
|
-
editorViewModeState =
|
|
75
|
-
interactionState =
|
|
83
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['width', 'table', 'media', 'selection', 'editorViewMode', 'interaction']),
|
|
84
|
+
widthState = _useSharedPluginState2.widthState,
|
|
85
|
+
tableState = _useSharedPluginState2.tableState,
|
|
86
|
+
mediaState = _useSharedPluginState2.mediaState,
|
|
87
|
+
selectionState = _useSharedPluginState2.selectionState,
|
|
88
|
+
editorViewModeState = _useSharedPluginState2.editorViewModeState,
|
|
89
|
+
interactionState = _useSharedPluginState2.interactionState;
|
|
76
90
|
var tableStateInternal = tableState;
|
|
77
91
|
return {
|
|
78
92
|
tableState: tableState,
|
|
@@ -13,7 +13,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
15
15
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
16
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
17
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
@@ -43,17 +42,24 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
43
42
|
"data-testid": "table-container"
|
|
44
43
|
}, children);
|
|
45
44
|
});
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
|
|
45
|
+
var useAlignmentTableContainerSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
|
|
46
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['table'], function (states) {
|
|
47
|
+
var _states$tableState, _states$tableState2;
|
|
48
|
+
return {
|
|
49
|
+
isFullWidthModeEnabled: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.isFullWidthModeEnabled,
|
|
50
|
+
wasFullWidthModeEnabled: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.wasFullWidthModeEnabled
|
|
51
|
+
};
|
|
52
|
+
}),
|
|
53
|
+
isFullWidthModeEnabled = _useSharedPluginState.isFullWidthModeEnabled,
|
|
54
|
+
wasFullWidthModeEnabled = _useSharedPluginState.wasFullWidthModeEnabled;
|
|
49
55
|
return {
|
|
50
56
|
tableState: undefined,
|
|
51
57
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
52
58
|
wasFullWidthModeEnabled: wasFullWidthModeEnabled
|
|
53
59
|
};
|
|
54
60
|
}, function (pluginInjectionApi) {
|
|
55
|
-
var
|
|
56
|
-
tableState =
|
|
61
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['table']),
|
|
62
|
+
tableState = _useSharedPluginState2.tableState;
|
|
57
63
|
return {
|
|
58
64
|
tableState: tableState,
|
|
59
65
|
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
@@ -67,10 +73,10 @@ var AlignmentTableContainer = function AlignmentTableContainer(_ref2) {
|
|
|
67
73
|
getPos = _ref2.getPos,
|
|
68
74
|
editorView = _ref2.editorView;
|
|
69
75
|
var alignment = node.attrs.layout !== _alignment.ALIGN_START ? _alignment.ALIGN_CENTER : _alignment.ALIGN_START;
|
|
70
|
-
var
|
|
71
|
-
tableState =
|
|
72
|
-
isFullWidthModeEnabled =
|
|
73
|
-
wasFullWidthModeEnabled =
|
|
76
|
+
var _useAlignmentTableCon = useAlignmentTableContainerSharedState(pluginInjectionApi),
|
|
77
|
+
tableState = _useAlignmentTableCon.tableState,
|
|
78
|
+
isFullWidthModeEnabled = _useAlignmentTableCon.isFullWidthModeEnabled,
|
|
79
|
+
wasFullWidthModeEnabled = _useAlignmentTableCon.wasFullWidthModeEnabled;
|
|
74
80
|
(0, _react.useEffect)(function () {
|
|
75
81
|
if (!tableState && (0, _experiments.editorExperiment)('platform_editor_usesharedpluginstateselector', false)) {
|
|
76
82
|
return;
|
|
@@ -129,20 +135,27 @@ var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_re
|
|
|
129
135
|
editorView: editorView
|
|
130
136
|
}, children);
|
|
131
137
|
};
|
|
132
|
-
var
|
|
133
|
-
var isFullWidthModeEnabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'table.isFullWidthModeEnabled');
|
|
134
|
-
var mode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
|
|
138
|
+
var selector = function selector(states) {
|
|
135
139
|
return {
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
tableState: states.tableState,
|
|
141
|
+
editorViewModeState: states.editorViewModeState
|
|
138
142
|
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
};
|
|
144
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
145
|
+
var _useSharedPluginState3 = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table', 'editorViewMode'], selector),
|
|
146
|
+
tableState = _useSharedPluginState3.tableState,
|
|
147
|
+
editorViewModeState = _useSharedPluginState3.editorViewModeState;
|
|
143
148
|
return {
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
tableState: tableState,
|
|
150
|
+
editorViewModeState: editorViewModeState
|
|
151
|
+
};
|
|
152
|
+
}, function (api) {
|
|
153
|
+
var _useSharedPluginState4 = (0, _hooks.useSharedPluginState)(api, ['table', 'editorViewMode']),
|
|
154
|
+
tableState = _useSharedPluginState4.tableState,
|
|
155
|
+
editorViewModeState = _useSharedPluginState4.editorViewModeState;
|
|
156
|
+
return {
|
|
157
|
+
tableState: tableState,
|
|
158
|
+
editorViewModeState: editorViewModeState
|
|
146
159
|
};
|
|
147
160
|
});
|
|
148
161
|
var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_react.default.memo(function (_ref4) {
|
|
@@ -169,9 +182,11 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
169
182
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
170
183
|
resizing = _useState2[0],
|
|
171
184
|
setIsResizing = _useState2[1];
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
185
|
+
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
186
|
+
tableState = _useSharedState.tableState,
|
|
187
|
+
editorViewModeState = _useSharedState.editorViewModeState;
|
|
188
|
+
var isFullWidthModeEnabled = tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled;
|
|
189
|
+
var mode = editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
175
190
|
var updateContainerHeight = (0, _react.useCallback)(function (height) {
|
|
176
191
|
var _containerRef$current;
|
|
177
192
|
// current StickyHeader State is not stable to be fetch.
|
|
@@ -36,7 +36,6 @@ var _analytics2 = require("../pm-plugins/utils/analytics");
|
|
|
36
36
|
var _guidelines = require("../pm-plugins/utils/guidelines");
|
|
37
37
|
var _snapping = require("../pm-plugins/utils/snapping");
|
|
38
38
|
var _consts2 = require("../ui/consts");
|
|
39
|
-
var _useInternalTablePluginStateSelector = require("../ui/hooks/useInternalTablePluginStateSelector");
|
|
40
39
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
41
40
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42
41
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -105,17 +104,23 @@ var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWi
|
|
|
105
104
|
return guideline.position && guideline.position.x !== undefined && typeof guideline.position.x === 'number' && Math.abs(guideline.position.x * 2) < width + guidelineVisibleAdjustment;
|
|
106
105
|
});
|
|
107
106
|
};
|
|
108
|
-
var
|
|
109
|
-
var
|
|
107
|
+
var selector = function selector(states) {
|
|
108
|
+
var _states$tableState;
|
|
109
|
+
return {
|
|
110
|
+
widthToWidest: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.widthToWidest
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
114
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table'], selector),
|
|
115
|
+
widthToWidest = _useSharedPluginState.widthToWidest;
|
|
110
116
|
return {
|
|
111
117
|
widthToWidest: widthToWidest
|
|
112
118
|
};
|
|
113
|
-
}, function (
|
|
114
|
-
var
|
|
115
|
-
tableState =
|
|
116
|
-
var tableStateInternal = tableState;
|
|
119
|
+
}, function (api) {
|
|
120
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['table']),
|
|
121
|
+
tableState = _useSharedPluginState2.tableState;
|
|
117
122
|
return {
|
|
118
|
-
widthToWidest:
|
|
123
|
+
widthToWidest: tableState === null || tableState === void 0 ? void 0 : tableState.widthToWidest
|
|
119
124
|
};
|
|
120
125
|
});
|
|
121
126
|
var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -21,7 +21,6 @@ var _nesting = require("@atlaskit/editor-common/nesting");
|
|
|
21
21
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
22
22
|
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
23
23
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
24
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
25
24
|
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
26
25
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
27
26
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -74,13 +73,19 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
|
74
73
|
return {};
|
|
75
74
|
};
|
|
76
75
|
var useTableSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
77
|
-
var
|
|
76
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
77
|
+
var _states$editorViewMod;
|
|
78
|
+
return {
|
|
79
|
+
mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
|
|
80
|
+
};
|
|
81
|
+
}),
|
|
82
|
+
mode = _useSharedPluginState.mode;
|
|
78
83
|
return {
|
|
79
84
|
mode: mode
|
|
80
85
|
};
|
|
81
86
|
}, function (api) {
|
|
82
|
-
var
|
|
83
|
-
editorViewModeState =
|
|
87
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['editorViewMode']),
|
|
88
|
+
editorViewModeState = _useSharedPluginState2.editorViewModeState;
|
|
84
89
|
return {
|
|
85
90
|
mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
86
91
|
};
|
|
@@ -25,7 +25,6 @@ var _mergedCells = require("../../pm-plugins/utils/merged-cells");
|
|
|
25
25
|
var _types = require("../../types");
|
|
26
26
|
var _consts = require("../consts");
|
|
27
27
|
var _DragPreview = require("../DragPreview");
|
|
28
|
-
var _useInternalTablePluginStateSelector = require("../hooks/useInternalTablePluginStateSelector");
|
|
29
28
|
var _HandleIconComponent = require("./HandleIconComponent");
|
|
30
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
30
|
/* eslint-disable @atlaskit/design-system/no-html-button */
|
|
@@ -254,15 +253,22 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
254
253
|
}), previewContainer));
|
|
255
254
|
};
|
|
256
255
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
257
|
-
var
|
|
258
|
-
|
|
256
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table'], function (states) {
|
|
257
|
+
var _states$tableState, _states$tableState2;
|
|
258
|
+
return {
|
|
259
|
+
hoveredColumns: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.hoveredColumns,
|
|
260
|
+
hoveredRows: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.hoveredRows
|
|
261
|
+
};
|
|
262
|
+
}),
|
|
263
|
+
hoveredColumns = _useSharedPluginState.hoveredColumns,
|
|
264
|
+
hoveredRows = _useSharedPluginState.hoveredRows;
|
|
259
265
|
return {
|
|
260
266
|
hoveredColumns: hoveredColumns,
|
|
261
267
|
hoveredRows: hoveredRows
|
|
262
268
|
};
|
|
263
269
|
}, function (api) {
|
|
264
|
-
var
|
|
265
|
-
tableState =
|
|
270
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['table']),
|
|
271
|
+
tableState = _useSharedPluginState2.tableState;
|
|
266
272
|
var tableStateInternal = tableState;
|
|
267
273
|
return {
|
|
268
274
|
hoveredColumns: tableStateInternal === null || tableStateInternal === void 0 ? void 0 : tableStateInternal.hoveredColumns,
|
|
@@ -8,7 +8,6 @@ exports.ColumnControls = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
12
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
12
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
14
13
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
@@ -33,13 +32,19 @@ var getSelectedColumns = function getSelectedColumns(selection) {
|
|
|
33
32
|
return [];
|
|
34
33
|
};
|
|
35
34
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
36
|
-
var
|
|
35
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
36
|
+
var _states$selectionStat;
|
|
37
|
+
return {
|
|
38
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
39
|
+
};
|
|
40
|
+
}),
|
|
41
|
+
selection = _useSharedPluginState.selection;
|
|
37
42
|
return {
|
|
38
43
|
selection: selection
|
|
39
44
|
};
|
|
40
45
|
}, function (api) {
|
|
41
|
-
var
|
|
42
|
-
selectionState =
|
|
46
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
47
|
+
selectionState = _useSharedPluginState2.selectionState;
|
|
43
48
|
return {
|
|
44
49
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
45
50
|
};
|
|
@@ -11,7 +11,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
15
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
16
15
|
var _commands = require("../../../pm-plugins/commands");
|
|
17
16
|
var _types = require("../../../types");
|
|
@@ -60,13 +59,19 @@ var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
|
60
59
|
}));
|
|
61
60
|
};
|
|
62
61
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
63
|
-
var
|
|
62
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
63
|
+
var _states$selectionStat;
|
|
64
|
+
return {
|
|
65
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
selection = _useSharedPluginState.selection;
|
|
64
69
|
return {
|
|
65
|
-
selection:
|
|
70
|
+
selection: selection
|
|
66
71
|
};
|
|
67
72
|
}, function (api) {
|
|
68
|
-
var
|
|
69
|
-
selectionState =
|
|
73
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
74
|
+
selectionState = _useSharedPluginState2.selectionState;
|
|
70
75
|
return {
|
|
71
76
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
72
77
|
};
|
|
@@ -7,17 +7,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.FloatingControlsWithSelection = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
10
|
var _ClassicCornerControls = require("./CornerControls/ClassicCornerControls");
|
|
12
11
|
var _ClassicControls = require("./RowControls/ClassicControls");
|
|
13
12
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
14
|
-
var
|
|
13
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
14
|
+
var _states$selectionStat;
|
|
15
|
+
return {
|
|
16
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
17
|
+
};
|
|
18
|
+
}),
|
|
19
|
+
selection = _useSharedPluginState.selection;
|
|
15
20
|
return {
|
|
16
|
-
selection:
|
|
21
|
+
selection: selection
|
|
17
22
|
};
|
|
18
23
|
}, function (api) {
|
|
19
|
-
var
|
|
20
|
-
selectionState =
|
|
24
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
25
|
+
selectionState = _useSharedPluginState2.selectionState;
|
|
21
26
|
return {
|
|
22
27
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
23
28
|
};
|
|
@@ -9,7 +9,6 @@ exports.DragControlsWithSelection = exports.DragControls = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
13
12
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
14
13
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
15
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -288,13 +287,19 @@ var DragControls = exports.DragControls = function DragControls(_ref) {
|
|
|
288
287
|
);
|
|
289
288
|
};
|
|
290
289
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
291
|
-
var
|
|
290
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
291
|
+
var _states$selectionStat;
|
|
292
|
+
return {
|
|
293
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
294
|
+
};
|
|
295
|
+
}),
|
|
296
|
+
selection = _useSharedPluginState.selection;
|
|
292
297
|
return {
|
|
293
|
-
selection:
|
|
298
|
+
selection: selection
|
|
294
299
|
};
|
|
295
300
|
}, function (api) {
|
|
296
|
-
var
|
|
297
|
-
selectionState =
|
|
301
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
302
|
+
selectionState = _useSharedPluginState2.selectionState;
|
|
298
303
|
return {
|
|
299
304
|
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
300
305
|
};
|