@atlaskit/editor-plugin-table 7.16.15 → 7.16.17
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 +29 -0
- package/dist/cjs/commands-with-analytics.js +66 -41
- package/dist/cjs/nodeviews/TableContainer.js +14 -12
- package/dist/cjs/nodeviews/TableResizer.js +12 -13
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/keymap.js +6 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +1 -1
- package/dist/cjs/toolbar.js +23 -48
- package/dist/cjs/ui/TableFloatingControls/index.js +2 -2
- package/dist/cjs/ui/icons/index.js +0 -7
- package/dist/cjs/utils/snapping.js +2 -2
- package/dist/es2019/commands-with-analytics.js +29 -6
- package/dist/es2019/nodeviews/TableContainer.js +17 -13
- package/dist/es2019/nodeviews/TableResizer.js +11 -12
- package/dist/es2019/plugin.js +3 -2
- package/dist/es2019/pm-plugins/keymap.js +7 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/es2019/toolbar.js +22 -48
- package/dist/es2019/ui/TableFloatingControls/index.js +2 -2
- package/dist/es2019/ui/icons/index.js +0 -1
- package/dist/es2019/utils/snapping.js +3 -3
- package/dist/esm/commands-with-analytics.js +66 -41
- package/dist/esm/nodeviews/TableContainer.js +15 -13
- package/dist/esm/nodeviews/TableResizer.js +14 -15
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/keymap.js +7 -1
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/esm/toolbar.js +24 -49
- package/dist/esm/ui/TableFloatingControls/index.js +2 -2
- package/dist/esm/ui/icons/index.js +0 -1
- package/dist/esm/utils/snapping.js +3 -3
- package/dist/types/commands/toggle.d.ts +1 -1
- package/dist/types/commands-with-analytics.d.ts +7 -4
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/toolbar.d.ts +2 -3
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -0
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -0
- package/dist/types/ui/TableFloatingControls/index.d.ts +2 -0
- package/dist/types/ui/icons/index.d.ts +0 -1
- package/dist/types-ts4.5/commands/toggle.d.ts +1 -1
- package/dist/types-ts4.5/commands-with-analytics.d.ts +7 -4
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +2 -3
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/index.d.ts +0 -1
- package/package.json +10 -4
- package/src/commands-with-analytics.ts +80 -40
- package/src/nodeviews/TableContainer.tsx +24 -14
- package/src/nodeviews/TableResizer.tsx +17 -9
- package/src/plugin.tsx +5 -2
- package/src/pm-plugins/keymap.ts +30 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
- package/src/toolbar.tsx +29 -55
- package/src/ui/TableFloatingControls/index.tsx +17 -16
- package/src/ui/icons/index.ts +0 -1
- package/src/utils/snapping.ts +4 -4
- package/dist/cjs/ui/icons/DisplayModeIcon.js +0 -46
- package/dist/es2019/ui/icons/DisplayModeIcon.js +0 -39
- package/dist/esm/ui/icons/DisplayModeIcon.js +0 -39
- package/dist/types/ui/icons/DisplayModeIcon.d.ts +0 -4
- package/dist/types-ts4.5/ui/icons/DisplayModeIcon.d.ts +0 -4
- package/src/ui/icons/DisplayModeIcon.tsx +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.16.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#106586](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106586)
|
|
8
|
+
[`f3486a7d141c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f3486a7d141c) -
|
|
9
|
+
Update usage of akEditorGutterPadding to its dynamic version which can increase padding to support
|
|
10
|
+
editor drag and drop. Breakout logic is also updated to accommodate extra padding.
|
|
11
|
+
- [#107920](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107920)
|
|
12
|
+
[`f918580d1700`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f918580d1700) -
|
|
13
|
+
[ux] Removes Table Lock button and addes a new menu item 'Fixed column widths' in the table's
|
|
14
|
+
floating toolbar menu instead of the button.
|
|
15
|
+
- [#107415](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107415)
|
|
16
|
+
[`f7f135cdedb8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f7f135cdedb8) -
|
|
17
|
+
ED-23441: Added analytics for table aligment changes caused by resizing or appearance changes"
|
|
18
|
+
- [#100714](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100714)
|
|
19
|
+
[`81849acfe13c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/81849acfe13c) -
|
|
20
|
+
ECA11Y-228: Added new shortcuts for insert column and row and added correct formatting for help
|
|
21
|
+
modal dialog
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 7.16.16
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#107213](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107213)
|
|
29
|
+
[`afae0e144fb2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/afae0e144fb2) -
|
|
30
|
+
[ux] Hide table selection control when blocks plugin enabled
|
|
31
|
+
|
|
3
32
|
## 7.16.15
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -4,12 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.wrapTableInExpandWithAnalytics = exports.
|
|
7
|
+
exports.wrapTableInExpandWithAnalytics = exports.toggleTableLayoutWithAnalytics = exports.toggleNumberColumnWithAnalytics = exports.toggleHeaderRowWithAnalytics = exports.toggleHeaderColumnWithAnalytics = exports.toggleFixedColumnWidthsOptionAnalytics = exports.splitCellWithAnalytics = exports.sortColumnWithAnalytics = exports.setTableAlignmentWithTableContentWithPosWithAnalytics = exports.setTableAlignmentWithAnalytics = exports.setColorWithAnalytics = exports.mergeCellsWithAnalytics = exports.insertRowWithAnalytics = exports.insertColumnWithAnalytics = exports.emptyMultipleCellsWithAnalytics = exports.distributeColumnsWidthsWithAnalytics = exports.deleteTableWithAnalytics = exports.deleteTableIfSelectedWithAnalytics = exports.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = exports.deleteRowsWithAnalytics = exports.deleteColumnsWithAnalytics = exports.changeColumnWidthByStepWithAnalytics = exports.addRowAroundSelection = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
12
12
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
15
|
var _clear = require("./commands/clear");
|
|
15
16
|
var _collapse = require("./commands/collapse");
|
|
@@ -500,47 +501,45 @@ var wrapTableInExpandWithAnalytics = exports.wrapTableInExpandWithAnalytics = fu
|
|
|
500
501
|
};
|
|
501
502
|
})(editorAnalyticsAPI)(_collapse.wrapTableInExpand);
|
|
502
503
|
};
|
|
503
|
-
var
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
})(editorAnalyticsAPI)((0, _preset.editorCommandToPMCommand)(_displayMode.setTableDisplayMode));
|
|
540
|
-
};
|
|
504
|
+
var toggleFixedColumnWidthsOptionAnalytics = exports.toggleFixedColumnWidthsOptionAnalytics = function toggleFixedColumnWidthsOptionAnalytics(editorAnalyticsAPI, inputMethod) {
|
|
505
|
+
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
506
|
+
var _getSelectedTableInfo13 = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
507
|
+
table = _getSelectedTableInfo13.table,
|
|
508
|
+
totalRowCount = _getSelectedTableInfo13.totalRowCount,
|
|
509
|
+
totalColumnCount = _getSelectedTableInfo13.totalColumnCount;
|
|
510
|
+
var previousDisplayMode;
|
|
511
|
+
var newDisplayMode;
|
|
512
|
+
switch (table === null || table === void 0 ? void 0 : table.node.attrs.displayMode) {
|
|
513
|
+
case 'fixed':
|
|
514
|
+
previousDisplayMode = _analytics.TABLE_DISPLAY_MODE.FIXED;
|
|
515
|
+
newDisplayMode = _analytics.TABLE_DISPLAY_MODE.DEFAULT;
|
|
516
|
+
break;
|
|
517
|
+
case 'default':
|
|
518
|
+
previousDisplayMode = _analytics.TABLE_DISPLAY_MODE.DEFAULT;
|
|
519
|
+
newDisplayMode = _analytics.TABLE_DISPLAY_MODE.FIXED;
|
|
520
|
+
break;
|
|
521
|
+
case null:
|
|
522
|
+
default:
|
|
523
|
+
previousDisplayMode = _analytics.TABLE_DISPLAY_MODE.INITIAL;
|
|
524
|
+
newDisplayMode = _analytics.TABLE_DISPLAY_MODE.FIXED;
|
|
525
|
+
}
|
|
526
|
+
return {
|
|
527
|
+
action: _analytics.TABLE_ACTION.CHANGED_DISPLAY_MODE,
|
|
528
|
+
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
529
|
+
attributes: {
|
|
530
|
+
inputMethod: inputMethod,
|
|
531
|
+
previousDisplayMode: previousDisplayMode,
|
|
532
|
+
newDisplayMode: newDisplayMode,
|
|
533
|
+
tableWidth: table === null || table === void 0 ? void 0 : table.node.attrs.width,
|
|
534
|
+
totalRowCount: totalRowCount,
|
|
535
|
+
totalColumnCount: totalColumnCount
|
|
536
|
+
},
|
|
537
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
538
|
+
};
|
|
539
|
+
})(editorAnalyticsAPI)((0, _preset.editorCommandToPMCommand)(_displayMode.setTableDisplayMode));
|
|
541
540
|
};
|
|
542
541
|
var setTableAlignmentWithAnalytics = exports.setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI) {
|
|
543
|
-
return function (newAlignment, previousAlignment, inputMethod) {
|
|
542
|
+
return function (newAlignment, previousAlignment, inputMethod, reason) {
|
|
544
543
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
545
544
|
var _getSelectedTableInfo14 = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
546
545
|
table = _getSelectedTableInfo14.table,
|
|
@@ -557,9 +556,35 @@ var setTableAlignmentWithAnalytics = exports.setTableAlignmentWithAnalytics = fu
|
|
|
557
556
|
previousAlignment: previousAlignment === 'center' || previousAlignment === 'align-start' ? previousAlignment : null,
|
|
558
557
|
totalRowCount: totalRowCount,
|
|
559
558
|
totalColumnCount: totalColumnCount,
|
|
560
|
-
inputMethod: inputMethod
|
|
559
|
+
inputMethod: inputMethod,
|
|
560
|
+
reason: reason
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
})(editorAnalyticsAPI)((0, _preset.editorCommandToPMCommand)((0, _misc.setTableAlignment)(newAlignment)));
|
|
564
564
|
};
|
|
565
|
+
};
|
|
566
|
+
var setTableAlignmentWithTableContentWithPosWithAnalytics = exports.setTableAlignmentWithTableContentWithPosWithAnalytics = function setTableAlignmentWithTableContentWithPosWithAnalytics(editorAnalyticsAPI) {
|
|
567
|
+
return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason) {
|
|
568
|
+
return (0, _analytics2.withEditorAnalyticsAPI)(function () {
|
|
569
|
+
var map = _tableMap.TableMap.get(tableNodeWithPos.node);
|
|
570
|
+
var totalRowCount = map.height;
|
|
571
|
+
var totalColumnCount = map.width;
|
|
572
|
+
var attributes = {
|
|
573
|
+
tableWidth: tableNodeWithPos.node.attrs.width,
|
|
574
|
+
newAlignment: newAlignment,
|
|
575
|
+
previousAlignment: previousAlignment,
|
|
576
|
+
totalRowCount: totalRowCount,
|
|
577
|
+
totalColumnCount: totalColumnCount,
|
|
578
|
+
inputMethod: inputMethod,
|
|
579
|
+
reason: reason
|
|
580
|
+
};
|
|
581
|
+
return {
|
|
582
|
+
action: _analytics.TABLE_ACTION.CHANGED_ALIGNMENT,
|
|
583
|
+
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
584
|
+
actionSubjectId: null,
|
|
585
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
586
|
+
attributes: attributes
|
|
587
|
+
};
|
|
588
|
+
})(editorAnalyticsAPI)((0, _preset.editorCommandToPMCommand)((0, _misc.setTableAlignmentWithTableContentWithPos)(newAlignment, tableNodeWithPos)));
|
|
589
|
+
};
|
|
565
590
|
};
|
|
@@ -9,12 +9,14 @@ exports.TableContainer = exports.ResizableTableContainer = exports.InnerContaine
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
14
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
14
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
-
var
|
|
16
|
+
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
16
17
|
var _utils = require("../pm-plugins/table-resizing/utils");
|
|
17
18
|
var _types = require("../types");
|
|
19
|
+
var _alignment = require("../utils/alignment");
|
|
18
20
|
var _TableResizer = require("./TableResizer");
|
|
19
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -50,25 +52,25 @@ var AlignmentTableContainer = function AlignmentTableContainer(_ref2) {
|
|
|
50
52
|
pluginInjectionApi = _ref2.pluginInjectionApi,
|
|
51
53
|
getPos = _ref2.getPos,
|
|
52
54
|
editorView = _ref2.editorView;
|
|
53
|
-
var alignment = node.attrs.layout;
|
|
55
|
+
var alignment = node.attrs.layout !== _alignment.ALIGN_START ? _alignment.ALIGN_CENTER : _alignment.ALIGN_START;
|
|
54
56
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['table']),
|
|
55
57
|
tableState = _useSharedPluginState.tableState;
|
|
56
58
|
(0, _react.useEffect)(function () {
|
|
57
59
|
if (tableState && editorView && getPos) {
|
|
58
60
|
var wasFullWidthModeEnabled = tableState.wasFullWidthModeEnabled,
|
|
59
61
|
isFullWidthModeEnabled = tableState.isFullWidthModeEnabled;
|
|
60
|
-
|
|
62
|
+
var state = editorView.state,
|
|
63
|
+
dispatch = editorView.dispatch;
|
|
64
|
+
if (wasFullWidthModeEnabled && isFullWidthModeEnabled !== undefined && !isFullWidthModeEnabled && alignment !== _alignment.ALIGN_CENTER && node.attrs.width > _editorSharedStyles.akEditorDefaultLayoutWidth) {
|
|
65
|
+
var _pluginInjectionApi$a;
|
|
61
66
|
var pos = getPos && getPos();
|
|
62
67
|
if (typeof pos !== 'number') {
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
|
-
|
|
70
|
+
(0, _commandsWithAnalytics.setTableAlignmentWithTableContentWithPosWithAnalytics)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(_alignment.ALIGN_CENTER, alignment, {
|
|
66
71
|
pos: pos,
|
|
67
72
|
node: node
|
|
68
|
-
})(
|
|
69
|
-
if (tr) {
|
|
70
|
-
editorView.dispatch(tr);
|
|
71
|
-
}
|
|
73
|
+
}, _analytics.INPUT_METHOD.AUTO, _analytics.CHANGE_ALIGNMENT_REASON.EDITOR_APPEARANCE_CHANGED)(state, dispatch);
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -181,8 +183,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
181
183
|
})) !== null && _pluginInjectionApi$g !== void 0 ? _pluginInjectionApi$g : false;
|
|
182
184
|
}, [pluginInjectionApi, editorView]);
|
|
183
185
|
var attachAnalyticsEvent = (0, _react.useCallback)(function (payload) {
|
|
184
|
-
var _pluginInjectionApi$
|
|
185
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
186
|
+
var _pluginInjectionApi$a2;
|
|
187
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions.attachAnalyticsEvent(payload);
|
|
186
188
|
}, [pluginInjectionApi]);
|
|
187
189
|
var displayGapCursor = (0, _react.useCallback)(function (toggle) {
|
|
188
190
|
var _pluginInjectionApi$c, _pluginInjectionApi$c2, _pluginInjectionApi$s;
|
|
@@ -202,13 +204,13 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
202
204
|
// When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
|
|
203
205
|
// When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
|
|
204
206
|
// scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
|
|
205
|
-
responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - _editorSharedStyles.
|
|
207
|
+
responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 - resizeHandleSpacing;
|
|
206
208
|
} else {
|
|
207
209
|
// 76 is currently an accepted padding value considering the spacing for resizer handle
|
|
208
210
|
// containerWidth = width of a DIV with test id="ak-editor-fp-content-area". It is a parent of
|
|
209
211
|
// a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
|
|
210
212
|
// padding left = padding right = akEditorGutterPadding = 32
|
|
211
|
-
responsiveContainerWidth = isTableScalingEnabled ? containerWidth - _editorSharedStyles.
|
|
213
|
+
responsiveContainerWidth = isTableScalingEnabled ? containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 : containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 - resizeHandleSpacing;
|
|
212
214
|
}
|
|
213
215
|
var width = Math.min(tableWidth, responsiveContainerWidth);
|
|
214
216
|
if (!isResizing) {
|
|
@@ -22,6 +22,7 @@ var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
|
22
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
23
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
24
24
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
|
+
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
25
26
|
var _misc = require("../commands/misc");
|
|
26
27
|
var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
27
28
|
var _utils3 = require("../pm-plugins/table-resizing/utils");
|
|
@@ -102,7 +103,7 @@ var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWi
|
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
105
|
var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
105
|
-
var _findTable, _editorView$state;
|
|
106
|
+
var _findTable, _editorView$state, _pluginInjectionApi$a2;
|
|
106
107
|
var children = _ref.children,
|
|
107
108
|
width = _ref.width,
|
|
108
109
|
maxWidth = _ref.maxWidth,
|
|
@@ -175,33 +176,31 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
175
176
|
if (isTableAlignmentEnabled && node && node.attrs.layout === _alignment.ALIGN_START && newWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH &&
|
|
176
177
|
// We don't want to switch alignment in Full-width editor
|
|
177
178
|
isResizing.current) {
|
|
179
|
+
var _pluginInjectionApi$a;
|
|
178
180
|
var tableNodeWithPos = {
|
|
179
181
|
pos: pos,
|
|
180
182
|
node: node
|
|
181
183
|
};
|
|
182
|
-
|
|
183
|
-
if (_tr) {
|
|
184
|
-
dispatch(_tr);
|
|
185
|
-
}
|
|
184
|
+
(0, _commandsWithAnalytics.setTableAlignmentWithTableContentWithPosWithAnalytics)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(_alignment.ALIGN_CENTER, _alignment.ALIGN_START, tableNodeWithPos, _analytics.INPUT_METHOD.AUTO, _analytics.CHANGE_ALIGNMENT_REASON.EDITOR_APPEARANCE_CHANGED)(state, dispatch);
|
|
186
185
|
return true;
|
|
187
186
|
}
|
|
188
187
|
return false;
|
|
189
|
-
}, [
|
|
188
|
+
}, [isTableAlignmentEnabled, lineLength, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions]);
|
|
190
189
|
(0, _react.useEffect)(function () {
|
|
191
190
|
return function () {
|
|
192
191
|
// only bring back the cursor if this table was deleted - i.e. if a user was resizing, then another
|
|
193
192
|
// deleted this table
|
|
194
193
|
if (isResizing.current) {
|
|
195
194
|
var dispatch = editorView.dispatch,
|
|
196
|
-
|
|
195
|
+
_tr = editorView.state.tr;
|
|
197
196
|
displayGapCursor(true);
|
|
198
197
|
displayGuideline([]);
|
|
199
|
-
|
|
198
|
+
_tr.setMeta(_tableWidth.pluginKey, {
|
|
200
199
|
resizing: false,
|
|
201
200
|
tableLocalId: '',
|
|
202
201
|
tableRef: null
|
|
203
202
|
});
|
|
204
|
-
dispatch(
|
|
203
|
+
dispatch(_tr);
|
|
205
204
|
}
|
|
206
205
|
};
|
|
207
206
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
@@ -315,13 +314,13 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
315
314
|
dispatch(tr);
|
|
316
315
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-resizing_uapcv')) {
|
|
317
316
|
if (delta.width < 0) {
|
|
318
|
-
var _pluginInjectionApi$
|
|
319
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
317
|
+
var _pluginInjectionApi$a3;
|
|
318
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeDecreaseScreenReaderInformation, {
|
|
320
319
|
newWidth: newWidth
|
|
321
320
|
}));
|
|
322
321
|
} else if (delta.width > 0) {
|
|
323
|
-
var _pluginInjectionApi$
|
|
324
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
322
|
+
var _pluginInjectionApi$a4;
|
|
323
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a4 === void 0 || _pluginInjectionApi$a4.actions.ariaNotify(formatMessage(_messages.tableMessages.tableSizeIncreaseScreenReaderInformation, {
|
|
325
324
|
newWidth: newWidth
|
|
326
325
|
}));
|
|
327
326
|
}
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -72,7 +72,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
75
|
-
var
|
|
75
|
+
var isTableScalingWithFixedColumnWidthsOptionEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
76
|
+
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
76
77
|
return {
|
|
77
78
|
name: 'table',
|
|
78
79
|
// Use getSharedState to store fullWidthEnabled and wasFullWidthModeEnabled to guarantee access
|
|
@@ -471,7 +472,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
471
472
|
},
|
|
472
473
|
floatingToolbar: (0, _toolbar.getToolbarConfig)(defaultGetEditorContainerWidth, editorAnalyticsAPI, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags, function () {
|
|
473
474
|
return editorViewRef.current;
|
|
474
|
-
}, options, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
475
|
+
}, options, isTableScalingWithFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
475
476
|
}
|
|
476
477
|
};
|
|
477
478
|
};
|
|
@@ -36,6 +36,12 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
36
36
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
37
37
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
38
38
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
39
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
|
|
40
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowBeforeVO.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
41
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfterVO.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
42
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBeforeVO.common, (0, _insert.addColumnBefore)(isTableScalingEnabled), list);
|
|
43
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfterVO.common, (0, _insert.addColumnAfter)(isTableScalingEnabled), list);
|
|
44
|
+
}
|
|
39
45
|
if (dragAndDropEnabled) {
|
|
40
46
|
// Move row/column shortcuts
|
|
41
47
|
/**
|
|
@@ -22,7 +22,7 @@ function getLayoutSize(tableLayout) {
|
|
|
22
22
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
23
23
|
var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
24
24
|
if (isFullWidthModeEnabled) {
|
|
25
|
-
return containerWidth ? Math.min(containerWidth - _editorSharedStyles.
|
|
25
|
+
return containerWidth ? Math.min(containerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
26
26
|
}
|
|
27
27
|
var calculatedTableWidth = (0, _styles.calcTableWidth)(tableLayout, containerWidth, true);
|
|
28
28
|
if (calculatedTableWidth !== 'inherit') {
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.isLayoutOptionDisabled = exports.getToolbarMenuConfig = exports.getToolbarConfig = exports.getToolbarCellOptionsConfig = exports.getSelectedAlignmentIcon = exports.
|
|
8
|
+
exports.isLayoutOptionDisabled = exports.getToolbarMenuConfig = exports.getToolbarConfig = exports.getToolbarCellOptionsConfig = exports.getSelectedAlignmentIcon = exports.getDistributeConfig = exports.getClosestSelectionRect = exports.getClosestSelectionOrTableRect = exports.getAlignmentOptionsConfig = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -37,7 +37,6 @@ var _tableWidth = require("./pm-plugins/table-width");
|
|
|
37
37
|
var _transforms = require("./transforms");
|
|
38
38
|
var _types = require("./types");
|
|
39
39
|
var _FloatingAlignmentButtons = require("./ui/FloatingAlignmentButtons/FloatingAlignmentButtons");
|
|
40
|
-
var _icons = require("./ui/icons");
|
|
41
40
|
var _utils4 = require("./utils");
|
|
42
41
|
var _alignment = require("./utils/alignment");
|
|
43
42
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -46,8 +45,19 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
46
45
|
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; } /** @jsx jsx */
|
|
47
46
|
var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
|
|
48
47
|
var formatMessage = _ref.formatMessage;
|
|
48
|
+
var isTableScalingWithFixedColumnWidthsOptionShown = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
49
|
+
var areTableColumnWidthsFixed = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
49
50
|
var optionItem = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'item-checkbox' : 'item';
|
|
50
51
|
var options = [{
|
|
52
|
+
id: 'editor.table.lockColumnWidths',
|
|
53
|
+
title: formatMessage(_messages.tableMessages.lockColumnWidths),
|
|
54
|
+
onClick: (0, _commandsWithAnalytics.toggleFixedColumnWidthsOptionAnalytics)(editorAnalyticsAPI, _analytics.INPUT_METHOD.FLOATING_TB),
|
|
55
|
+
selected: areTableColumnWidthsFixed,
|
|
56
|
+
hidden: !isTableScalingWithFixedColumnWidthsOptionShown,
|
|
57
|
+
domItemOptions: {
|
|
58
|
+
type: optionItem
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
51
61
|
id: 'editor.table.headerRow',
|
|
52
62
|
title: formatMessage(_messages.tableMessages.headerRow),
|
|
53
63
|
onClick: (0, _commandsWithAnalytics.toggleHeaderRowWithAnalytics)(editorAnalyticsAPI),
|
|
@@ -95,7 +105,8 @@ var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMen
|
|
|
95
105
|
hidden: options.every(function (option) {
|
|
96
106
|
return option.hidden;
|
|
97
107
|
}),
|
|
98
|
-
options: options
|
|
108
|
+
options: options,
|
|
109
|
+
dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
|
|
99
110
|
};
|
|
100
111
|
} else {
|
|
101
112
|
return {
|
|
@@ -106,7 +117,8 @@ var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMen
|
|
|
106
117
|
hidden: options.every(function (option) {
|
|
107
118
|
return option.hidden;
|
|
108
119
|
}),
|
|
109
|
-
options: options
|
|
120
|
+
options: options,
|
|
121
|
+
dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
|
|
110
122
|
};
|
|
111
123
|
}
|
|
112
124
|
};
|
|
@@ -320,7 +332,8 @@ var getClosestSelectionOrTableRect = exports.getClosestSelectionOrTableRect = fu
|
|
|
320
332
|
return (0, _utils3.isSelectionType)(selection, 'cell') ? (0, _utils3.getSelectionRect)(selection) : tableRect;
|
|
321
333
|
};
|
|
322
334
|
var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options) {
|
|
323
|
-
var
|
|
335
|
+
var isTableScalingWithFixedColumnWidthsOptionEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
336
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
324
337
|
return function (config) {
|
|
325
338
|
return function (state, intl) {
|
|
326
339
|
var tableObject = (0, _utils3.findTable)(state.selection);
|
|
@@ -332,9 +345,11 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
332
345
|
var isWidthResizing = tableWidthState === null || tableWidthState === void 0 ? void 0 : tableWidthState.resizing;
|
|
333
346
|
if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
|
|
334
347
|
var nodeType = state.schema.nodes.table;
|
|
335
|
-
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
|
|
336
|
-
var alignmentMenu;
|
|
337
348
|
var isNested = pluginState.tablePos && (0, _utils4.isTableNested)(state, pluginState.tablePos);
|
|
349
|
+
var isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingWithFixedColumnWidthsOptionEnabled && !isNested;
|
|
350
|
+
var areTableColumWidthsFixed = tableObject.node.attrs.displayMode === 'fixed';
|
|
351
|
+
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
352
|
+
var alignmentMenu;
|
|
338
353
|
alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth) : [];
|
|
339
354
|
var cellItems;
|
|
340
355
|
cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
@@ -450,23 +465,6 @@ var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerW
|
|
|
450
465
|
}
|
|
451
466
|
return [];
|
|
452
467
|
};
|
|
453
|
-
var getLockBtnConfig = exports.getLockBtnConfig = function getLockBtnConfig(editorAnalyticsAPI) {
|
|
454
|
-
return function (state, dispatch, editorView) {
|
|
455
|
-
var selectionOrTableRect = getClosestSelectionOrTableRect(state);
|
|
456
|
-
if (!editorView || !selectionOrTableRect) {
|
|
457
|
-
return false;
|
|
458
|
-
}
|
|
459
|
-
var tr = state.tr;
|
|
460
|
-
var table = (0, _utils3.findTable)(tr.selection);
|
|
461
|
-
if (!table) {
|
|
462
|
-
return false;
|
|
463
|
-
} else {
|
|
464
|
-
var displayMode = table.node.attrs.displayMode;
|
|
465
|
-
(0, _commandsWithAnalytics.toggleTableLockWithAnalytics)(editorAnalyticsAPI)(displayMode, _analytics.INPUT_METHOD.FLOATING_TB)(state, dispatch);
|
|
466
|
-
return true;
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
};
|
|
470
468
|
var getDistributeConfig = exports.getDistributeConfig = function getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
471
469
|
var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
472
470
|
return function (state, dispatch, editorView) {
|
|
@@ -497,29 +495,6 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
|
|
|
497
495
|
var newResizeStateWithAnalytics = (0, _resizeState.getNewResizeStateFromSelectedColumns)(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
|
|
498
496
|
var wouldChange = (_newResizeStateWithAn2 = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn2 !== void 0 ? _newResizeStateWithAn2 : false;
|
|
499
497
|
var items = [];
|
|
500
|
-
var isNested = pluginState.tablePos && (0, _utils4.isTableNested)(editorState, pluginState.tablePos);
|
|
501
|
-
var isTableScalingLockBtnEnabled = !isNested && isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
502
|
-
if (isTableScalingLockBtnEnabled) {
|
|
503
|
-
var _pluginState$tableNod;
|
|
504
|
-
var areColumnWidthsLocked = (pluginState === null || pluginState === void 0 || (_pluginState$tableNod = pluginState.tableNode) === null || _pluginState$tableNod === void 0 ? void 0 : _pluginState$tableNod.attrs.displayMode) === 'fixed';
|
|
505
|
-
var title = areColumnWidthsLocked ? formatMessage(_messages.tableMessages.unlockColumnWidths) : formatMessage(_messages.tableMessages.lockColumnWidths);
|
|
506
|
-
items.push({
|
|
507
|
-
id: 'editor.table.lockColumns',
|
|
508
|
-
type: 'button',
|
|
509
|
-
title: title,
|
|
510
|
-
icon: function icon() {
|
|
511
|
-
return (0, _react.jsx)(_icons.DisplayModeIcon, {
|
|
512
|
-
size: "medium",
|
|
513
|
-
label: title
|
|
514
|
-
});
|
|
515
|
-
},
|
|
516
|
-
onClick: function onClick(state, dispatch, view) {
|
|
517
|
-
return getLockBtnConfig(editorAnalyticsAPI)(state, dispatch, view);
|
|
518
|
-
},
|
|
519
|
-
selected: areColumnWidthsLocked,
|
|
520
|
-
testId: 'table-lock-column-widths-btn'
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
498
|
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns && pluginState.isDragAndDropEnabled) {
|
|
524
499
|
items.push({
|
|
525
500
|
id: 'editor.table.distributeColumns',
|
|
@@ -632,7 +607,7 @@ var getAlignmentOptionsConfig = exports.getAlignmentOptionsConfig = function get
|
|
|
632
607
|
icon: icon,
|
|
633
608
|
title: formatMessage(layoutToMessages[value]),
|
|
634
609
|
selected: (0, _alignment.normaliseAlignment)(currentLayout) === value,
|
|
635
|
-
onClick: (0, _commandsWithAnalytics.setTableAlignmentWithAnalytics)(editorAnalyticsAPI)(value, currentLayout, _analytics.INPUT_METHOD.FLOATING_TB)
|
|
610
|
+
onClick: (0, _commandsWithAnalytics.setTableAlignmentWithAnalytics)(editorAnalyticsAPI)(value, currentLayout, _analytics.INPUT_METHOD.FLOATING_TB, _analytics.CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
|
|
636
611
|
}, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth) && {
|
|
637
612
|
disabled: value !== 'center'
|
|
638
613
|
});
|
|
@@ -98,7 +98,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
98
98
|
updateCellHoverLocation: updateCellHoverLocation,
|
|
99
99
|
stickyTop: stickyTop,
|
|
100
100
|
isDragAndDropEnabled: isDragAndDropEnabled
|
|
101
|
-
}) : null, tableActive && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/_react.default.createElement(_CornerControls.DragCornerControlsWithSelection, {
|
|
101
|
+
}) : null, tableActive && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.drag-and-drop_wmv9t') && ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-shared-state-hook') ? /*#__PURE__*/_react.default.createElement(_CornerControls.DragCornerControlsWithSelection, {
|
|
102
102
|
editorView: editorView,
|
|
103
103
|
tableRef: tableRef,
|
|
104
104
|
isInDanger: isInDanger,
|
|
@@ -109,7 +109,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
109
109
|
tableRef: tableRef,
|
|
110
110
|
isInDanger: isInDanger,
|
|
111
111
|
isResizing: isResizing
|
|
112
|
-
}), /*#__PURE__*/_react.default.createElement(_RowControls.DragControls, {
|
|
112
|
+
})), /*#__PURE__*/_react.default.createElement(_RowControls.DragControls, {
|
|
113
113
|
tableRef: tableRef,
|
|
114
114
|
tableNode: tableNode,
|
|
115
115
|
hoveredCell: hoveredCell,
|
|
@@ -27,12 +27,6 @@ Object.defineProperty(exports, "AddRowBelowIcon", {
|
|
|
27
27
|
return _AddRowBelowIcon.AddRowBelowIcon;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "DisplayModeIcon", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _DisplayModeIcon.DisplayModeIcon;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
30
|
Object.defineProperty(exports, "DragHandleDisabledIcon", {
|
|
37
31
|
enumerable: true,
|
|
38
32
|
get: function get() {
|
|
@@ -72,7 +66,6 @@ Object.defineProperty(exports, "SplitCellIcon", {
|
|
|
72
66
|
var _DragHandleIcon = require("./DragHandleIcon");
|
|
73
67
|
var _DragInMotionIcon = require("./DragInMotionIcon");
|
|
74
68
|
var _DragHandleDisabledIcon = require("./DragHandleDisabledIcon");
|
|
75
|
-
var _DisplayModeIcon = require("./DisplayModeIcon");
|
|
76
69
|
var _MinimisedHandle = require("./MinimisedHandle");
|
|
77
70
|
var _MergeCellsIcon = require("./MergeCellsIcon");
|
|
78
71
|
var _SplitCellIcon = require("./SplitCellIcon");
|
|
@@ -26,7 +26,7 @@ var calculateDefaultTablePreserveSnappings = exports.calculateDefaultTablePreser
|
|
|
26
26
|
innerGuidelines: false,
|
|
27
27
|
breakoutPoints: false
|
|
28
28
|
};
|
|
29
|
-
var dynamicFullWidthLine = editorContainerWith - _editorSharedStyles.
|
|
29
|
+
var dynamicFullWidthLine = editorContainerWith - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 >= _editorSharedStyles.akEditorFullWidthLayoutWidth ? _editorSharedStyles.akEditorFullWidthLayoutWidth : editorContainerWith - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2;
|
|
30
30
|
var guides = [dynamicFullWidthLine - lengthOffset];
|
|
31
31
|
if (!exclude.breakoutPoints) {
|
|
32
32
|
guides.unshift(_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset);
|
|
@@ -44,7 +44,7 @@ var defaultTablePreserveSnappingWidths = exports.defaultTablePreserveSnappingWid
|
|
|
44
44
|
innerGuidelines: false,
|
|
45
45
|
breakoutPoints: false
|
|
46
46
|
};
|
|
47
|
-
return editorContainerWidth - _editorSharedStyles.
|
|
47
|
+
return editorContainerWidth - (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2 > _editorSharedStyles.akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
/**
|