@atlaskit/editor-plugin-table 13.0.4 → 13.0.6
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 +15 -0
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +19 -98
- package/dist/cjs/nodeviews/TableContainer.js +14 -53
- package/dist/cjs/nodeviews/TableResizer.js +2 -15
- package/dist/cjs/nodeviews/table.js +4 -4
- package/dist/cjs/tablePlugin.js +30 -213
- package/dist/cjs/ui/DragHandle/index.js +9 -26
- package/dist/cjs/ui/DragPreview/index.js +1 -1
- package/dist/cjs/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -1
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +7 -20
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +6 -19
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +7 -20
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +7 -20
- package/dist/cjs/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/cjs/ui/global-styles.js +4 -17
- package/dist/cjs/ui/icons/SortingIconWrapper.js +2 -15
- package/dist/cjs/ui/ui-styles.js +1 -1
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +21 -102
- package/dist/es2019/nodeviews/TableContainer.js +11 -54
- package/dist/es2019/nodeviews/TableResizer.js +2 -17
- package/dist/es2019/nodeviews/table.js +4 -4
- package/dist/es2019/tablePlugin.js +19 -211
- package/dist/es2019/ui/DragHandle/index.js +8 -27
- package/dist/es2019/ui/DragPreview/index.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +3 -3
- package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +7 -22
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +7 -22
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +7 -22
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +7 -22
- package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/es2019/ui/global-styles.js +6 -21
- package/dist/es2019/ui/icons/SortingIconWrapper.js +3 -18
- package/dist/es2019/ui/ui-styles.js +1 -1
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +20 -99
- package/dist/esm/nodeviews/TableContainer.js +15 -54
- package/dist/esm/nodeviews/TableResizer.js +3 -16
- package/dist/esm/nodeviews/table.js +4 -4
- package/dist/esm/tablePlugin.js +24 -208
- package/dist/esm/ui/DragHandle/index.js +10 -27
- package/dist/esm/ui/DragPreview/index.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/styles.js +1 -1
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +8 -21
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +7 -20
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +8 -21
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +8 -21
- package/dist/esm/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/esm/ui/global-styles.js +5 -18
- package/dist/esm/ui/icons/SortingIconWrapper.js +3 -16
- package/dist/esm/ui/ui-styles.js +1 -1
- package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +1 -1
- package/package.json +4 -4
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -11,43 +11,35 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
14
|
-
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
15
|
-
var _getDomRefFromSelection = require("@atlaskit/editor-common/get-dom-ref-from-selection");
|
|
16
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
17
15
|
var _icons = require("@atlaskit/editor-common/icons");
|
|
18
16
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
19
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
20
18
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
21
19
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
22
|
-
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
23
20
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
24
|
-
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
25
21
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
26
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
27
22
|
var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
|
|
28
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
29
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
30
24
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
31
25
|
var _toDOM = require("./nodeviews/toDOM");
|
|
32
26
|
var _plugin = require("./pm-plugins/analytics/plugin");
|
|
33
|
-
var _pluginKey = require("./pm-plugins/analytics/plugin-key");
|
|
34
27
|
var _insert = require("./pm-plugins/commands/insert");
|
|
35
28
|
var _createPluginConfig = require("./pm-plugins/create-plugin-config");
|
|
36
29
|
var _plugin2 = require("./pm-plugins/decorations/plugin");
|
|
37
30
|
var _plugin3 = require("./pm-plugins/drag-and-drop/plugin");
|
|
38
|
-
var
|
|
31
|
+
var _pluginKey = require("./pm-plugins/drag-and-drop/plugin-key");
|
|
39
32
|
var _keymap = require("./pm-plugins/keymap");
|
|
40
33
|
var _main = require("./pm-plugins/main");
|
|
41
|
-
var
|
|
34
|
+
var _pluginKey2 = require("./pm-plugins/plugin-key");
|
|
42
35
|
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
43
36
|
var _plugin4 = require("./pm-plugins/sticky-headers/plugin");
|
|
44
|
-
var
|
|
37
|
+
var _pluginKey3 = require("./pm-plugins/sticky-headers/plugin-key");
|
|
45
38
|
var _util = require("./pm-plugins/sticky-headers/util");
|
|
46
39
|
var _tableAnalytics = require("./pm-plugins/table-analytics");
|
|
47
40
|
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
48
41
|
var _plugin5 = require("./pm-plugins/table-resizing/plugin");
|
|
49
42
|
var _pluginFactory = require("./pm-plugins/table-resizing/plugin-factory");
|
|
50
|
-
var _pluginKey5 = require("./pm-plugins/table-resizing/plugin-key");
|
|
51
43
|
var _tableSelectionKeymap = require("./pm-plugins/table-selection-keymap");
|
|
52
44
|
var _tableSizeSelector = require("./pm-plugins/table-size-selector");
|
|
53
45
|
var _tableWidth = require("./pm-plugins/table-width");
|
|
@@ -55,48 +47,20 @@ var _tableWidthInCommentFix = require("./pm-plugins/table-width-in-comment-fix")
|
|
|
55
47
|
var _create = require("./pm-plugins/utils/create");
|
|
56
48
|
var _viewModeSort = require("./pm-plugins/view-mode-sort");
|
|
57
49
|
var _ContentComponent = require("./ui/ContentComponent");
|
|
58
|
-
var _FloatingContextualButton = _interopRequireDefault(require("./ui/FloatingContextualButton"));
|
|
59
|
-
var _FloatingContextualMenu = _interopRequireDefault(require("./ui/FloatingContextualMenu"));
|
|
60
|
-
var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteButton"));
|
|
61
|
-
var _FloatingDragMenu = _interopRequireDefault(require("./ui/FloatingDragMenu"));
|
|
62
|
-
var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
|
|
63
|
-
var _FloatingToolbarLabel = require("./ui/FloatingToolbarLabel/FloatingToolbarLabel");
|
|
64
|
-
var _globalStyles = require("./ui/global-styles");
|
|
65
|
-
var _SizeSelector = require("./ui/SizeSelector");
|
|
66
|
-
var _TableFullWidthLabel = require("./ui/TableFullWidthLabel");
|
|
67
50
|
var _toolbar = require("./ui/toolbar");
|
|
68
51
|
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); }
|
|
69
52
|
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; }
|
|
70
|
-
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; }
|
|
71
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
53
|
+
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; }
|
|
72
54
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
73
55
|
return {};
|
|
74
56
|
};
|
|
75
|
-
var useTableSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
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;
|
|
83
|
-
return {
|
|
84
|
-
mode: mode
|
|
85
|
-
};
|
|
86
|
-
}, function (api) {
|
|
87
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['editorViewMode']),
|
|
88
|
-
editorViewModeState = _useSharedPluginState2.editorViewModeState;
|
|
89
|
-
return {
|
|
90
|
-
mode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
57
|
|
|
94
58
|
/**
|
|
95
59
|
* Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
96
60
|
* from `@atlaskit/editor-core`.
|
|
97
61
|
*/
|
|
98
62
|
var tablePlugin = function tablePlugin(_ref) {
|
|
99
|
-
var _api$analytics,
|
|
63
|
+
var _api$analytics, _options$getEditorFea, _options$getEditorFea2, _api$analytics2;
|
|
100
64
|
var options = _ref.config,
|
|
101
65
|
api = _ref.api;
|
|
102
66
|
var editorViewRef = {
|
|
@@ -109,7 +73,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
109
73
|
};
|
|
110
74
|
};
|
|
111
75
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
112
|
-
var ariaNotifyPlugin = api === null || api === void 0 || (_api$accessibilityUti = api.accessibilityUtils) === null || _api$accessibilityUti === void 0 ? void 0 : _api$accessibilityUti.actions.ariaNotify;
|
|
113
76
|
var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
114
77
|
var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (isTableFixedColumnWidthsOptionEnabled || ( // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
|
|
115
78
|
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
@@ -127,12 +90,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
127
90
|
}
|
|
128
91
|
|
|
129
92
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
130
|
-
var tablePluginState =
|
|
93
|
+
var tablePluginState = _pluginKey2.pluginKey.getState(editorState);
|
|
131
94
|
var tableResizingPluginState = (0, _pluginFactory.getPluginState)(editorState);
|
|
132
95
|
var tableWidthResizingPluginState = _tableWidth.pluginKey.getState(editorState);
|
|
133
|
-
var stickyHeadersState =
|
|
96
|
+
var stickyHeadersState = _pluginKey3.pluginKey.getState(editorState);
|
|
134
97
|
var stickyHeader = stickyHeadersState ? (0, _util.findStickyHeaderForTable)(stickyHeadersState, tablePluginState === null || tablePluginState === void 0 ? void 0 : tablePluginState.tablePos) : undefined;
|
|
135
|
-
var dragAndDropState =
|
|
98
|
+
var dragAndDropState = _pluginKey.pluginKey.getState(editorState);
|
|
136
99
|
var sizeSelectorPluginState = _tableSizeSelector.pluginKey.getState(editorState);
|
|
137
100
|
var sharedStateInternal = {
|
|
138
101
|
isFullWidthModeEnabled: !!(options !== null && options !== void 0 && options.fullWidthEnabled),
|
|
@@ -480,178 +443,27 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
480
443
|
return plugins;
|
|
481
444
|
},
|
|
482
445
|
contentComponent: function contentComponent(_ref18) {
|
|
483
|
-
var _api$featureFlags;
|
|
484
446
|
var editorView = _ref18.editorView,
|
|
485
447
|
popupsMountPoint = _ref18.popupsMountPoint,
|
|
486
448
|
popupsBoundariesElement = _ref18.popupsBoundariesElement,
|
|
487
449
|
popupsScrollableElement = _ref18.popupsScrollableElement,
|
|
488
450
|
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
editorView: editorView,
|
|
493
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
494
|
-
options: options,
|
|
495
|
-
popupsMountPoint: popupsMountPoint,
|
|
496
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
497
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
498
|
-
defaultGetEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
499
|
-
defaultGetEditorFeatureFlags: defaultGetEditorFeatureFlags,
|
|
500
|
-
isTableSelectorEnabled: isTableSelectorEnabled
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
504
|
-
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
451
|
+
return /*#__PURE__*/_react.default.createElement(_ContentComponent.ContentComponent, {
|
|
452
|
+
api: api,
|
|
453
|
+
editorView: editorView,
|
|
505
454
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
tablePluginState: _pluginKey3.pluginKey,
|
|
515
|
-
tableWidthPluginState: _tableWidth.pluginKey,
|
|
516
|
-
tableResizingPluginState: _pluginKey5.pluginKey,
|
|
517
|
-
stickyHeadersState: _pluginKey4.pluginKey,
|
|
518
|
-
dragAndDropState: _pluginKey2.pluginKey,
|
|
519
|
-
sizeSelectorPluginState: _tableSizeSelector.pluginKey
|
|
520
|
-
},
|
|
521
|
-
render: function render(_ref19) {
|
|
522
|
-
var _sizeSelectorPluginSt, _api$analytics3;
|
|
523
|
-
var resizingPluginState = _ref19.tableResizingPluginState,
|
|
524
|
-
stickyHeadersState = _ref19.stickyHeadersState,
|
|
525
|
-
tablePluginState = _ref19.tablePluginState,
|
|
526
|
-
tableWidthPluginState = _ref19.tableWidthPluginState,
|
|
527
|
-
dragAndDropState = _ref19.dragAndDropState,
|
|
528
|
-
sizeSelectorPluginState = _ref19.sizeSelectorPluginState;
|
|
529
|
-
// Any changes made inside `<WithPluginState>` need to be reflected in the
|
|
530
|
-
// `<ContentComponent>` as well.
|
|
531
|
-
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
532
|
-
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
533
|
-
var resizingTableLocalId = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableLocalId;
|
|
534
|
-
var resizingTableRef = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableRef;
|
|
535
|
-
var isResizing = isColumnResizing || isTableResizing;
|
|
536
|
-
var widthToWidest = tablePluginState === null || tablePluginState === void 0 ? void 0 : tablePluginState.widthToWidest;
|
|
537
|
-
var isSizeSelectorOpen = sizeSelectorPluginState === null || sizeSelectorPluginState === void 0 ? void 0 : sizeSelectorPluginState.isSelectorOpen;
|
|
538
|
-
var _ref20 = tablePluginState,
|
|
539
|
-
tableNode = _ref20.tableNode,
|
|
540
|
-
tablePos = _ref20.tablePos,
|
|
541
|
-
targetCellPosition = _ref20.targetCellPosition,
|
|
542
|
-
isContextualMenuOpen = _ref20.isContextualMenuOpen,
|
|
543
|
-
tableRef = _ref20.tableRef,
|
|
544
|
-
pluginConfig = _ref20.pluginConfig,
|
|
545
|
-
insertColumnButtonIndex = _ref20.insertColumnButtonIndex,
|
|
546
|
-
insertRowButtonIndex = _ref20.insertRowButtonIndex,
|
|
547
|
-
isHeaderColumnEnabled = _ref20.isHeaderColumnEnabled,
|
|
548
|
-
isHeaderRowEnabled = _ref20.isHeaderRowEnabled,
|
|
549
|
-
isDragAndDropEnabled = _ref20.isDragAndDropEnabled,
|
|
550
|
-
tableWrapperTarget = _ref20.tableWrapperTarget,
|
|
551
|
-
isCellMenuOpenByKeyboard = _ref20.isCellMenuOpenByKeyboard;
|
|
552
|
-
var allowControls = pluginConfig.allowControls;
|
|
553
|
-
var stickyHeader = stickyHeadersState ? (0, _util.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
554
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, targetCellPosition && (tableRef || isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/_react.default.createElement(_FloatingContextualButton.default, {
|
|
555
|
-
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
556
|
-
editorView: editorView,
|
|
557
|
-
tableNode: tableNode,
|
|
558
|
-
mountPoint: popupsMountPoint,
|
|
559
|
-
targetCellPosition: targetCellPosition,
|
|
560
|
-
scrollableElement: popupsScrollableElement,
|
|
561
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
562
|
-
isContextualMenuOpen: isContextualMenuOpen,
|
|
563
|
-
stickyHeader: stickyHeader,
|
|
564
|
-
tableWrapper: tableWrapperTarget,
|
|
565
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
566
|
-
}), allowControls && /*#__PURE__*/_react.default.createElement(_FloatingInsertButton.default, {
|
|
567
|
-
tableNode: tableNode,
|
|
568
|
-
tableRef: tableRef,
|
|
569
|
-
insertColumnButtonIndex: insertColumnButtonIndex,
|
|
570
|
-
insertRowButtonIndex: insertRowButtonIndex,
|
|
571
|
-
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
572
|
-
isHeaderRowEnabled: isHeaderRowEnabled,
|
|
573
|
-
isDragAndDropEnabled: isDragAndDropEnabled,
|
|
574
|
-
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
575
|
-
editorView: editorView,
|
|
576
|
-
mountPoint: popupsMountPoint,
|
|
577
|
-
boundariesElement: popupsBoundariesElement,
|
|
578
|
-
scrollableElement: popupsScrollableElement,
|
|
579
|
-
hasStickyHeaders: stickyHeader && stickyHeader.sticky,
|
|
580
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
581
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
582
|
-
getEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
583
|
-
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
584
|
-
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
585
|
-
api: api,
|
|
586
|
-
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor
|
|
587
|
-
}), (options === null || options === void 0 ? void 0 : options.allowContextualMenu) && /*#__PURE__*/_react.default.createElement(_FloatingContextualMenu.default, {
|
|
588
|
-
editorView: editorView,
|
|
589
|
-
mountPoint: popupsMountPoint,
|
|
590
|
-
boundariesElement: popupsBoundariesElement,
|
|
591
|
-
targetCellPosition: targetCellPosition,
|
|
592
|
-
isOpen: Boolean(isContextualMenuOpen) && !isResizing,
|
|
593
|
-
pluginConfig: pluginConfig,
|
|
594
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
595
|
-
getEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
596
|
-
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
597
|
-
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
598
|
-
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
599
|
-
api: api
|
|
600
|
-
}), isDragAndDropEnabled && /*#__PURE__*/_react.default.createElement(_FloatingDragMenu.default, {
|
|
601
|
-
editorView: editorView,
|
|
602
|
-
mountPoint: popupsMountPoint,
|
|
603
|
-
boundariesElement: popupsBoundariesElement,
|
|
604
|
-
tableRef: tableRef,
|
|
605
|
-
tableNode: tableNode,
|
|
606
|
-
targetCellPosition: targetCellPosition,
|
|
607
|
-
direction: dragAndDropState === null || dragAndDropState === void 0 ? void 0 : dragAndDropState.dragMenuDirection,
|
|
608
|
-
index: dragAndDropState === null || dragAndDropState === void 0 ? void 0 : dragAndDropState.dragMenuIndex,
|
|
609
|
-
isOpen: !!(dragAndDropState !== null && dragAndDropState !== void 0 && dragAndDropState.isDragMenuOpen) && !isResizing,
|
|
610
|
-
getEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
611
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
612
|
-
stickyHeaders: stickyHeader,
|
|
613
|
-
pluginConfig: pluginConfig,
|
|
614
|
-
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
615
|
-
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
616
|
-
ariaNotifyPlugin: ariaNotifyPlugin,
|
|
617
|
-
api: api,
|
|
618
|
-
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor
|
|
619
|
-
}), allowControls && !isDragAndDropEnabled && !isResizing && /*#__PURE__*/_react.default.createElement(_FloatingDeleteButton.default, {
|
|
620
|
-
editorView: editorView,
|
|
621
|
-
selection: editorView.state.selection,
|
|
622
|
-
tableRef: tableRef,
|
|
623
|
-
mountPoint: popupsMountPoint,
|
|
624
|
-
boundariesElement: popupsBoundariesElement,
|
|
625
|
-
scrollableElement: popupsScrollableElement,
|
|
626
|
-
stickyHeaders: stickyHeader,
|
|
627
|
-
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
628
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
629
|
-
api: api
|
|
630
|
-
}), ((options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || (options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) && options.isCommentEditor) && isTableResizing && widthToWidest && resizingTableLocalId && resizingTableRef && widthToWidest[resizingTableLocalId] && /*#__PURE__*/_react.default.createElement(_FloatingToolbarLabel.FloatingToolbarLabel, {
|
|
631
|
-
target: resizingTableRef,
|
|
632
|
-
content: (0, _experiments.editorExperiment)('single_column_layouts', true) ? /*#__PURE__*/_react.default.createElement(_resizer.ResizerBreakoutModeLabel, {
|
|
633
|
-
layout: "full-width"
|
|
634
|
-
}) : /*#__PURE__*/_react.default.createElement(_TableFullWidthLabel.FullWidthDisplay, null),
|
|
635
|
-
alignX: 'center',
|
|
636
|
-
alignY: 'bottom',
|
|
637
|
-
stick: true,
|
|
638
|
-
forcePlacement: true,
|
|
639
|
-
zIndex: _editorSharedStyles.akEditorFloatingPanelZIndex,
|
|
640
|
-
offset: [0, 10]
|
|
641
|
-
}), isTableSelectorEnabled && isSizeSelectorOpen && /*#__PURE__*/_react.default.createElement(_SizeSelector.SizeSelector, {
|
|
642
|
-
api: api,
|
|
643
|
-
isOpenedByKeyboard: false,
|
|
644
|
-
popupsMountPoint: popupsMountPoint,
|
|
645
|
-
target: (_sizeSelectorPluginSt = sizeSelectorPluginState === null || sizeSelectorPluginState === void 0 ? void 0 : sizeSelectorPluginState.targetRef) !== null && _sizeSelectorPluginSt !== void 0 ? _sizeSelectorPluginSt : (0, _getDomRefFromSelection.getDomRefFromSelection)(editorView, _analytics.ACTION_SUBJECT_ID.PICKER_TABLE_SIZE, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions),
|
|
646
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
647
|
-
popupsScrollableElement: popupsScrollableElement
|
|
648
|
-
}));
|
|
649
|
-
}
|
|
650
|
-
}));
|
|
455
|
+
options: options,
|
|
456
|
+
popupsMountPoint: popupsMountPoint,
|
|
457
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
458
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
459
|
+
defaultGetEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
460
|
+
defaultGetEditorFeatureFlags: defaultGetEditorFeatureFlags,
|
|
461
|
+
isTableSelectorEnabled: isTableSelectorEnabled
|
|
462
|
+
});
|
|
651
463
|
},
|
|
652
464
|
pluginsOptions: {
|
|
653
|
-
quickInsert: function quickInsert(
|
|
654
|
-
var formatMessage =
|
|
465
|
+
quickInsert: function quickInsert(_ref19) {
|
|
466
|
+
var formatMessage = _ref19.formatMessage;
|
|
655
467
|
return [{
|
|
656
468
|
id: 'table',
|
|
657
469
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -722,10 +534,15 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
722
534
|
return editorViewRef.current;
|
|
723
535
|
}, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
724
536
|
},
|
|
725
|
-
usePluginHook: function usePluginHook(
|
|
726
|
-
var editorView =
|
|
727
|
-
var
|
|
728
|
-
|
|
537
|
+
usePluginHook: function usePluginHook(_ref20) {
|
|
538
|
+
var editorView = _ref20.editorView;
|
|
539
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
540
|
+
var _states$editorViewMod;
|
|
541
|
+
return {
|
|
542
|
+
mode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
|
|
543
|
+
};
|
|
544
|
+
}),
|
|
545
|
+
mode = _useSharedPluginState.mode;
|
|
729
546
|
(0, _react.useEffect)(function () {
|
|
730
547
|
var state = editorView.state,
|
|
731
548
|
dispatch = editorView.dispatch;
|
|
@@ -254,29 +254,6 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
254
254
|
height: previewHeight
|
|
255
255
|
}), previewContainer));
|
|
256
256
|
};
|
|
257
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
258
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table'], function (states) {
|
|
259
|
-
var _states$tableState, _states$tableState2;
|
|
260
|
-
return {
|
|
261
|
-
hoveredColumns: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.hoveredColumns,
|
|
262
|
-
hoveredRows: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.hoveredRows
|
|
263
|
-
};
|
|
264
|
-
}),
|
|
265
|
-
hoveredColumns = _useSharedPluginState.hoveredColumns,
|
|
266
|
-
hoveredRows = _useSharedPluginState.hoveredRows;
|
|
267
|
-
return {
|
|
268
|
-
hoveredColumns: hoveredColumns,
|
|
269
|
-
hoveredRows: hoveredRows
|
|
270
|
-
};
|
|
271
|
-
}, function (api) {
|
|
272
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['table']),
|
|
273
|
-
tableState = _useSharedPluginState2.tableState;
|
|
274
|
-
var tableStateInternal = tableState;
|
|
275
|
-
return {
|
|
276
|
-
hoveredColumns: tableStateInternal === null || tableStateInternal === void 0 ? void 0 : tableStateInternal.hoveredColumns,
|
|
277
|
-
hoveredRows: tableStateInternal === null || tableStateInternal === void 0 ? void 0 : tableStateInternal.hoveredRows
|
|
278
|
-
};
|
|
279
|
-
});
|
|
280
257
|
var DragHandleComponentWithSharedState = function DragHandleComponentWithSharedState(_ref5) {
|
|
281
258
|
var isDragMenuTarget = _ref5.isDragMenuTarget,
|
|
282
259
|
tableLocalId = _ref5.tableLocalId,
|
|
@@ -294,9 +271,15 @@ var DragHandleComponentWithSharedState = function DragHandleComponentWithSharedS
|
|
|
294
271
|
editorView = _ref5.editorView,
|
|
295
272
|
intl = _ref5.intl,
|
|
296
273
|
api = _ref5.api;
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
|
|
274
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table'], function (states) {
|
|
275
|
+
var _states$tableState, _states$tableState2;
|
|
276
|
+
return {
|
|
277
|
+
hoveredColumns: (_states$tableState = states.tableState) === null || _states$tableState === void 0 ? void 0 : _states$tableState.hoveredColumns,
|
|
278
|
+
hoveredRows: (_states$tableState2 = states.tableState) === null || _states$tableState2 === void 0 ? void 0 : _states$tableState2.hoveredRows
|
|
279
|
+
};
|
|
280
|
+
}),
|
|
281
|
+
hoveredColumns = _useSharedPluginState.hoveredColumns,
|
|
282
|
+
hoveredRows = _useSharedPluginState.hoveredRows;
|
|
300
283
|
return /*#__PURE__*/_react.default.createElement(DragHandleComponent, {
|
|
301
284
|
isDragMenuTarget: isDragMenuTarget,
|
|
302
285
|
tableLocalId: tableLocalId,
|
|
@@ -13,7 +13,7 @@ var _DragInMotionIcon = require("../icons/DragInMotionIcon");
|
|
|
13
13
|
var boxStyles = (0, _primitives.xcss)({
|
|
14
14
|
borderColor: 'color.border.focused',
|
|
15
15
|
borderStyle: 'solid',
|
|
16
|
-
borderRadius: '
|
|
16
|
+
borderRadius: 'radius.small',
|
|
17
17
|
borderWidth: 'border.width.outline',
|
|
18
18
|
backgroundColor: 'color.blanket.selected'
|
|
19
19
|
});
|
|
@@ -18,7 +18,7 @@ var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = func
|
|
|
18
18
|
'> div': _objectSpread({
|
|
19
19
|
// Sits behind button to provide surface-color background
|
|
20
20
|
background: "var(--ds-surface, ".concat(_colors.N20, ")"),
|
|
21
|
-
borderRadius: "var(--ds-
|
|
21
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
22
22
|
display: 'flex',
|
|
23
23
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
24
24
|
height: "".concat(_consts.contextualMenuTriggerSize + 2, "px"),
|
|
@@ -23,5 +23,5 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
23
23
|
var tablePopupStyles = exports.tablePopupStyles = function tablePopupStyles(isDragAndDropEnabled
|
|
24
24
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
25
25
|
) {
|
|
26
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 20px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.CONTEXTUAL_SUBMENU, "var(--ds-
|
|
26
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 20px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.CONTEXTUAL_SUBMENU, "var(--ds-radius-small, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), isDragAndDropEnabled ? _consts.contextualMenuDropdownWidthDnD : _consts.contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.CONTEXTUAL_MENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-radius-small, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"), _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL, _adfSchema.tableBackgroundBorderColor, "var(--ds-radius-small, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
27
27
|
};
|
|
@@ -23,7 +23,7 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
23
23
|
|
|
24
24
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
25
25
|
var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
|
|
26
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; /* move the submenu down when 'sort increasing/decreasing' appear before background color picker */\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-
|
|
26
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; /* move the submenu down when 'sort increasing/decreasing' appear before background color picker */\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-radius-small, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-radius-small, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -31,24 +31,6 @@ var getSelectedColumns = function getSelectedColumns(selection) {
|
|
|
31
31
|
}
|
|
32
32
|
return [];
|
|
33
33
|
};
|
|
34
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
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;
|
|
42
|
-
return {
|
|
43
|
-
selection: selection
|
|
44
|
-
};
|
|
45
|
-
}, function (api) {
|
|
46
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
47
|
-
selectionState = _useSharedPluginState2.selectionState;
|
|
48
|
-
return {
|
|
49
|
-
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
34
|
var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
53
35
|
var _colWidths$map$join;
|
|
54
36
|
var editorView = _ref.editorView,
|
|
@@ -67,8 +49,13 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
|
67
49
|
getScrollOffset = _ref.getScrollOffset,
|
|
68
50
|
api = _ref.api;
|
|
69
51
|
var columnControlsRef = (0, _react.useRef)(null);
|
|
70
|
-
var
|
|
71
|
-
|
|
52
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
53
|
+
var _states$selectionStat;
|
|
54
|
+
return {
|
|
55
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
selection = _useSharedPluginState.selection;
|
|
72
59
|
var widths = (_colWidths$map$join = colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(function (width) {
|
|
73
60
|
return (
|
|
74
61
|
// when there is sticky header, a `margin-right: -1px` applied to `tr.sticky th` so it causes colWidths to be 1px wider
|
|
@@ -58,7 +58,12 @@ var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
|
58
58
|
className: _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER
|
|
59
59
|
}));
|
|
60
60
|
};
|
|
61
|
-
var
|
|
61
|
+
var DragCornerControlsComponentWithSelection = function DragCornerControlsComponentWithSelection(_ref2) {
|
|
62
|
+
var editorView = _ref2.editorView,
|
|
63
|
+
isInDanger = _ref2.isInDanger,
|
|
64
|
+
isResizing = _ref2.isResizing,
|
|
65
|
+
formatMessage = _ref2.intl.formatMessage,
|
|
66
|
+
api = _ref2.api;
|
|
62
67
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
63
68
|
var _states$selectionStat;
|
|
64
69
|
return {
|
|
@@ -66,24 +71,6 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
66
71
|
};
|
|
67
72
|
}),
|
|
68
73
|
selection = _useSharedPluginState.selection;
|
|
69
|
-
return {
|
|
70
|
-
selection: selection
|
|
71
|
-
};
|
|
72
|
-
}, function (api) {
|
|
73
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
74
|
-
selectionState = _useSharedPluginState2.selectionState;
|
|
75
|
-
return {
|
|
76
|
-
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
var DragCornerControlsComponentWithSelection = function DragCornerControlsComponentWithSelection(_ref2) {
|
|
80
|
-
var editorView = _ref2.editorView,
|
|
81
|
-
isInDanger = _ref2.isInDanger,
|
|
82
|
-
isResizing = _ref2.isResizing,
|
|
83
|
-
formatMessage = _ref2.intl.formatMessage,
|
|
84
|
-
api = _ref2.api;
|
|
85
|
-
var _useSharedState = useSharedState(api),
|
|
86
|
-
selection = _useSharedState.selection;
|
|
87
74
|
var handleOnClick = function handleOnClick() {
|
|
88
75
|
var state = editorView.state,
|
|
89
76
|
dispatch = editorView.dispatch;
|
|
@@ -9,24 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _ClassicCornerControls = require("./CornerControls/ClassicCornerControls");
|
|
11
11
|
var _ClassicControls = require("./RowControls/ClassicControls");
|
|
12
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
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;
|
|
20
|
-
return {
|
|
21
|
-
selection: selection
|
|
22
|
-
};
|
|
23
|
-
}, function (api) {
|
|
24
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
25
|
-
selectionState = _useSharedPluginState2.selectionState;
|
|
26
|
-
return {
|
|
27
|
-
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
12
|
var FloatingControlsWithSelection = exports.FloatingControlsWithSelection = function FloatingControlsWithSelection(_ref) {
|
|
31
13
|
var editorView = _ref.editorView,
|
|
32
14
|
tableRef = _ref.tableRef,
|
|
@@ -40,8 +22,13 @@ var FloatingControlsWithSelection = exports.FloatingControlsWithSelection = func
|
|
|
40
22
|
selectRow = _ref.selectRow,
|
|
41
23
|
tableActive = _ref.tableActive,
|
|
42
24
|
api = _ref.api;
|
|
43
|
-
var
|
|
44
|
-
|
|
25
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
26
|
+
var _states$selectionStat;
|
|
27
|
+
return {
|
|
28
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
29
|
+
};
|
|
30
|
+
}),
|
|
31
|
+
selection = _useSharedPluginState.selection;
|
|
45
32
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ClassicCornerControls.CornerControls, {
|
|
46
33
|
editorView: editorView,
|
|
47
34
|
tableRef: tableRef,
|
|
@@ -286,24 +286,6 @@ var DragControls = exports.DragControls = function DragControls(_ref) {
|
|
|
286
286
|
}), rowHandles())
|
|
287
287
|
);
|
|
288
288
|
};
|
|
289
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
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;
|
|
297
|
-
return {
|
|
298
|
-
selection: selection
|
|
299
|
-
};
|
|
300
|
-
}, function (api) {
|
|
301
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['selection']),
|
|
302
|
-
selectionState = _useSharedPluginState2.selectionState;
|
|
303
|
-
return {
|
|
304
|
-
selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
|
|
305
|
-
};
|
|
306
|
-
});
|
|
307
289
|
var DragControlsWithSelection = exports.DragControlsWithSelection = function DragControlsWithSelection(_ref5) {
|
|
308
290
|
var editorView = _ref5.editorView,
|
|
309
291
|
tableRef = _ref5.tableRef,
|
|
@@ -319,8 +301,13 @@ var DragControlsWithSelection = exports.DragControlsWithSelection = function Dra
|
|
|
319
301
|
selectRows = _ref5.selectRows,
|
|
320
302
|
updateCellHoverLocation = _ref5.updateCellHoverLocation,
|
|
321
303
|
api = _ref5.api;
|
|
322
|
-
var
|
|
323
|
-
|
|
304
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['selection'], function (states) {
|
|
305
|
+
var _states$selectionStat;
|
|
306
|
+
return {
|
|
307
|
+
selection: (_states$selectionStat = states.selectionState) === null || _states$selectionStat === void 0 ? void 0 : _states$selectionStat.selection
|
|
308
|
+
};
|
|
309
|
+
}),
|
|
310
|
+
selection = _useSharedPluginState.selection;
|
|
324
311
|
return /*#__PURE__*/_react.default.createElement(DragControls, {
|
|
325
312
|
editorView: editorView,
|
|
326
313
|
tableRef: tableRef,
|
|
@@ -15,7 +15,7 @@ var tableFullWidthLabelWrapperStyles = (0, _primitives.xcss)({
|
|
|
15
15
|
height: "var(--ds-space-400, 32px)",
|
|
16
16
|
display: 'flex',
|
|
17
17
|
backgroundColor: 'elevation.surface.overlay',
|
|
18
|
-
borderRadius: '
|
|
18
|
+
borderRadius: 'radius.small',
|
|
19
19
|
boxShadow: 'elevation.shadow.overlay',
|
|
20
20
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
21
21
|
lineHeight: 1,
|