@atlaskit/editor-plugin-table 25.0.1 → 25.0.3
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 +14 -0
- package/dist/cjs/nodeviews/TableComponent.js +7 -10
- package/dist/cjs/nodeviews/table.js +4 -6
- package/dist/cjs/tablePlugin.js +5 -8
- package/dist/es2019/nodeviews/TableComponent.js +4 -7
- package/dist/es2019/nodeviews/table.js +5 -6
- package/dist/es2019/tablePlugin.js +5 -8
- package/dist/esm/nodeviews/TableComponent.js +7 -10
- package/dist/esm/nodeviews/table.js +4 -6
- package/dist/esm/tablePlugin.js +5 -8
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 25.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 25.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7a8d5e478d5d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7a8d5e478d5d1) -
|
|
14
|
+
Clean up feature gate `platform_editor_table_fixed_column_width_prop`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 25.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -26,7 +26,6 @@ var _table = require("@atlaskit/editor-common/table");
|
|
|
26
26
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
27
27
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
28
28
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
29
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
29
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
31
30
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
32
31
|
var _commands = require("../pm-plugins/commands");
|
|
@@ -608,7 +607,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
608
607
|
isResizing = _this$props9.isResizing,
|
|
609
608
|
view = _this$props9.view,
|
|
610
609
|
getPos = _this$props9.getPos,
|
|
611
|
-
getEditorFeatureFlags = _this$props9.getEditorFeatureFlags,
|
|
612
610
|
options = _this$props9.options;
|
|
613
611
|
if (!this.table) {
|
|
614
612
|
return;
|
|
@@ -639,7 +637,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
639
637
|
var isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged;
|
|
640
638
|
var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || this.state.windowResized;
|
|
641
639
|
if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
|
|
642
|
-
var _this$containerWidth2, _this$props0,
|
|
640
|
+
var _this$containerWidth2, _this$props0, _this$props$options3, _this$props$options4, _this$props$options5;
|
|
643
641
|
var isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
|
|
644
642
|
var wasTableResized = (0, _colgroup.hasTableBeenResized)(this.node);
|
|
645
643
|
var isTableResized = (0, _colgroup.hasTableBeenResized)(tableNode);
|
|
@@ -657,7 +655,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
657
655
|
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
658
656
|
isTableResized: isTableResized
|
|
659
657
|
});
|
|
660
|
-
var tableWithFixedColumnWidthsOption = ((
|
|
658
|
+
var tableWithFixedColumnWidthsOption = ((_this$props0 = this.props) === null || _this$props0 === void 0 ? void 0 : _this$props0.allowFixedColumnWidthOption) || false;
|
|
661
659
|
var isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
|
|
662
660
|
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
|
|
663
661
|
if (force || !isResizing && shouldUpdateColgroup) {
|
|
@@ -722,7 +720,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
722
720
|
}, {
|
|
723
721
|
key: "componentDidUpdate",
|
|
724
722
|
value: function componentDidUpdate(_, prevState) {
|
|
725
|
-
var
|
|
723
|
+
var _this$props$options0, _this$props$options1;
|
|
726
724
|
var _this$props1 = this.props,
|
|
727
725
|
getNode = _this$props1.getNode,
|
|
728
726
|
isMediaFullscreen = _this$props1.isMediaFullscreen,
|
|
@@ -732,11 +730,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
732
730
|
options = _this$props1.options,
|
|
733
731
|
isTableScalingEnabled = _this$props1.isTableScalingEnabled,
|
|
734
732
|
getPos = _this$props1.getPos,
|
|
735
|
-
getEditorFeatureFlags = _this$props1.getEditorFeatureFlags,
|
|
736
733
|
allowFixedColumnWidthOption = _this$props1.allowFixedColumnWidthOption;
|
|
737
734
|
var shouldScale = false;
|
|
738
735
|
var shouldHandleColgroupUpdates = false;
|
|
739
|
-
var tableWithFixedColumnWidthsOption =
|
|
736
|
+
var tableWithFixedColumnWidthsOption = allowFixedColumnWidthOption || false;
|
|
740
737
|
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
741
738
|
shouldScale = true;
|
|
742
739
|
shouldHandleColgroupUpdates = true;
|
|
@@ -921,9 +918,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
921
918
|
tablePos = undefined;
|
|
922
919
|
}
|
|
923
920
|
var isNested = (0, _nodes.isTableNested)(view.state, tablePos);
|
|
924
|
-
var
|
|
925
|
-
|
|
926
|
-
tableWithFixedColumnWidthsOption =
|
|
921
|
+
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
922
|
+
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
923
|
+
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag2 === void 0 ? false : _getEditorFeatureFlag2;
|
|
927
924
|
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$options12 = this.props.options) !== null && _this$props$options12 !== void 0 && _this$props$options12.isCommentEditor));
|
|
928
925
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
|
|
929
926
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -23,7 +23,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
25
25
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
26
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
26
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
28
27
|
var _createPluginConfig = require("../pm-plugins/create-plugin-config");
|
|
29
28
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -112,11 +111,11 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
112
111
|
}).toDOM(this.node);
|
|
113
112
|
var rendered = _model.DOMSerializer.renderSpec(document, tableDOMStructure);
|
|
114
113
|
if (rendered.dom) {
|
|
115
|
-
var _this$reactComponentP5, _this$
|
|
114
|
+
var _this$reactComponentP5, _this$options, _this$options2;
|
|
116
115
|
var tableElement = rendered.dom.querySelector('table');
|
|
117
116
|
this.table = tableElement ? tableElement : rendered.dom;
|
|
118
117
|
this.renderedDOM = rendered.dom;
|
|
119
|
-
var allowFixedColumnWidthOption = ((
|
|
118
|
+
var allowFixedColumnWidthOption = ((_this$reactComponentP5 = this.reactComponentProps) === null || _this$reactComponentP5 === void 0 ? void 0 : _this$reactComponentP5.allowFixedColumnWidthOption) || false;
|
|
120
119
|
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && allowFixedColumnWidthOption && this.node.attrs.displayMode === 'fixed') {
|
|
121
120
|
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos(), this.reactComponentProps.allowTableResizing);
|
|
122
121
|
if (tableInlineWidth) {
|
|
@@ -228,7 +227,6 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
228
227
|
_this$reactComponentP7,
|
|
229
228
|
_this3 = this,
|
|
230
229
|
_this$reactComponentP8,
|
|
231
|
-
_this$getEditorFeatur2,
|
|
232
230
|
_this$options3,
|
|
233
231
|
_this$options4;
|
|
234
232
|
if (!this.table) {
|
|
@@ -254,7 +252,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
254
252
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
255
253
|
_this3.table.setAttribute(attr, attrs[attr]);
|
|
256
254
|
});
|
|
257
|
-
var isTableFixedColumnWidthsOptionEnabled = ((
|
|
255
|
+
var isTableFixedColumnWidthsOptionEnabled = ((_this$reactComponentP8 = this.reactComponentProps) === null || _this$reactComponentP8 === void 0 ? void 0 : _this$reactComponentP8.allowFixedColumnWidthOption) || false;
|
|
258
256
|
// Preserve Table Width cannot have inline width set on the table
|
|
259
257
|
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && node.attrs.displayMode === 'fixed') {
|
|
260
258
|
var _tableWidthPluginKey$;
|
|
@@ -377,7 +375,7 @@ var createTableView = exports.createTableView = function createTableView(node, v
|
|
|
377
375
|
allowControls = _getPluginConfig.allowControls,
|
|
378
376
|
allowTableResizing = _getPluginConfig.allowTableResizing,
|
|
379
377
|
allowTableAlignment = _getPluginConfig.allowTableAlignment;
|
|
380
|
-
var isTableFixedColumnWidthsOptionEnabled =
|
|
378
|
+
var isTableFixedColumnWidthsOptionEnabled = allowFixedColumnWidthOption || false;
|
|
381
379
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
|
|
382
380
|
return new TableView({
|
|
383
381
|
node: node,
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -72,7 +72,7 @@ var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
|
72
72
|
* from `@atlaskit/editor-core`.
|
|
73
73
|
*/
|
|
74
74
|
var tablePlugin = function tablePlugin(_ref) {
|
|
75
|
-
var _config$tableOptions, _api$analytics, _options$getEditorFea
|
|
75
|
+
var _config$tableOptions, _api$analytics, _options$getEditorFea;
|
|
76
76
|
var config = _ref.config,
|
|
77
77
|
api = _ref.api;
|
|
78
78
|
var editorViewRef = {
|
|
@@ -89,12 +89,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
91
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
92
|
-
var isTableFixedColumnWidthsOptionEnabled =
|
|
92
|
+
var isTableFixedColumnWidthsOptionEnabled = options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption;
|
|
93
93
|
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
|
|
94
94
|
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
95
95
|
var isTableSelectorEnabled =
|
|
96
96
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
97
|
-
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$
|
|
97
|
+
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableSelector) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
|
|
98
98
|
if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
99
99
|
var _api$uiControlRegistr;
|
|
100
100
|
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _getTableMenuComponents.getTableMenuComponents)({
|
|
@@ -244,14 +244,11 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
246
|
nodes: function nodes() {
|
|
247
|
-
var _options$tableOptions2
|
|
247
|
+
var _options$tableOptions2;
|
|
248
248
|
var _pluginConfig = (0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions),
|
|
249
249
|
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
250
250
|
// TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
|
|
251
251
|
var isNestingSupported = Boolean(options === null || options === void 0 || (_options$tableOptions2 = options.tableOptions) === null || _options$tableOptions2 === void 0 ? void 0 : _options$tableOptions2.allowNestedTables);
|
|
252
|
-
var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption : options === null || options === void 0 || (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
253
|
-
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
|
|
254
|
-
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
255
252
|
var isTableScalingEnabled = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
256
253
|
var isCommentEditor = options === null || options === void 0 ? void 0 : options.isCommentEditor;
|
|
257
254
|
var isChromelessEditor = options === null || options === void 0 ? void 0 : options.isChromelessEditor;
|
|
@@ -318,7 +315,7 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
318
315
|
isCommentEditor = _ref3.isCommentEditor,
|
|
319
316
|
isChromelessEditor = _ref3.isChromelessEditor,
|
|
320
317
|
__livePage = _ref3.__livePage;
|
|
321
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor,
|
|
318
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableFixedColumnWidthsOptionEnabled, __livePage);
|
|
322
319
|
}
|
|
323
320
|
}, {
|
|
324
321
|
name: 'tablePMColResizing',
|
|
@@ -13,7 +13,6 @@ import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
|
13
13
|
import { isValidPosition } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
18
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
18
|
import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/commands';
|
|
@@ -566,7 +565,6 @@ class TableComponent extends React.Component {
|
|
|
566
565
|
isResizing,
|
|
567
566
|
view,
|
|
568
567
|
getPos,
|
|
569
|
-
getEditorFeatureFlags,
|
|
570
568
|
options
|
|
571
569
|
} = this.props;
|
|
572
570
|
if (!this.table) {
|
|
@@ -600,7 +598,7 @@ class TableComponent extends React.Component {
|
|
|
600
598
|
const isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged;
|
|
601
599
|
const maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || this.state.windowResized;
|
|
602
600
|
if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
|
|
603
|
-
var _this$containerWidth2, _this$props,
|
|
601
|
+
var _this$containerWidth2, _this$props, _this$props$options3, _this$props$options4, _this$props$options5;
|
|
604
602
|
const isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
|
|
605
603
|
const wasTableResized = hasTableBeenResized(this.node);
|
|
606
604
|
const isTableResized = hasTableBeenResized(tableNode);
|
|
@@ -618,7 +616,7 @@ class TableComponent extends React.Component {
|
|
|
618
616
|
isFullWidthModeAndLineLengthChanged,
|
|
619
617
|
isTableResized
|
|
620
618
|
});
|
|
621
|
-
const tableWithFixedColumnWidthsOption = (
|
|
619
|
+
const tableWithFixedColumnWidthsOption = ((_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.allowFixedColumnWidthOption) || false;
|
|
622
620
|
const isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
|
|
623
621
|
const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
|
|
624
622
|
if (force || !isResizing && shouldUpdateColgroup) {
|
|
@@ -681,7 +679,7 @@ class TableComponent extends React.Component {
|
|
|
681
679
|
// Ignored via go/ees005
|
|
682
680
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
683
681
|
componentDidUpdate(_, prevState) {
|
|
684
|
-
var
|
|
682
|
+
var _this$props$options10, _this$props$options11;
|
|
685
683
|
const {
|
|
686
684
|
getNode,
|
|
687
685
|
isMediaFullscreen,
|
|
@@ -692,12 +690,11 @@ class TableComponent extends React.Component {
|
|
|
692
690
|
isTableScalingEnabled,
|
|
693
691
|
// we could use options.isTableScalingEnabled here
|
|
694
692
|
getPos,
|
|
695
|
-
getEditorFeatureFlags,
|
|
696
693
|
allowFixedColumnWidthOption
|
|
697
694
|
} = this.props;
|
|
698
695
|
let shouldScale = false;
|
|
699
696
|
let shouldHandleColgroupUpdates = false;
|
|
700
|
-
const tableWithFixedColumnWidthsOption =
|
|
697
|
+
const tableWithFixedColumnWidthsOption = allowFixedColumnWidthOption || false;
|
|
701
698
|
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
702
699
|
shouldScale = true;
|
|
703
700
|
shouldHandleColgroupUpdates = true;
|
|
@@ -9,7 +9,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
9
9
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
11
11
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
15
14
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -85,11 +84,11 @@ export default class TableView extends ReactNodeView {
|
|
|
85
84
|
}).toDOM(this.node);
|
|
86
85
|
const rendered = DOMSerializer.renderSpec(document, tableDOMStructure);
|
|
87
86
|
if (rendered.dom) {
|
|
88
|
-
var _this$reactComponentP5, _this$
|
|
87
|
+
var _this$reactComponentP5, _this$options, _this$options2;
|
|
89
88
|
const tableElement = rendered.dom.querySelector('table');
|
|
90
89
|
this.table = tableElement ? tableElement : rendered.dom;
|
|
91
90
|
this.renderedDOM = rendered.dom;
|
|
92
|
-
const allowFixedColumnWidthOption = (
|
|
91
|
+
const allowFixedColumnWidthOption = ((_this$reactComponentP5 = this.reactComponentProps) === null || _this$reactComponentP5 === void 0 ? void 0 : _this$reactComponentP5.allowFixedColumnWidthOption) || false;
|
|
93
92
|
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && allowFixedColumnWidthOption && this.node.attrs.displayMode === 'fixed') {
|
|
94
93
|
const tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos(), this.reactComponentProps.allowTableResizing);
|
|
95
94
|
if (tableInlineWidth) {
|
|
@@ -194,7 +193,7 @@ export default class TableView extends ReactNodeView {
|
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
195
|
setDomAttrs(node) {
|
|
197
|
-
var _this$reactComponentP6, _this$reactComponentP7, _this$reactComponentP8, _this$
|
|
196
|
+
var _this$reactComponentP6, _this$reactComponentP7, _this$reactComponentP8, _this$options3, _this$options4;
|
|
198
197
|
if (!this.table) {
|
|
199
198
|
return; // width / attribute application to actual table will happen later when table is set
|
|
200
199
|
}
|
|
@@ -218,7 +217,7 @@ export default class TableView extends ReactNodeView {
|
|
|
218
217
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
219
218
|
this.table.setAttribute(attr, attrs[attr]);
|
|
220
219
|
});
|
|
221
|
-
const isTableFixedColumnWidthsOptionEnabled = (
|
|
220
|
+
const isTableFixedColumnWidthsOptionEnabled = ((_this$reactComponentP8 = this.reactComponentProps) === null || _this$reactComponentP8 === void 0 ? void 0 : _this$reactComponentP8.allowFixedColumnWidthOption) || false;
|
|
222
221
|
// Preserve Table Width cannot have inline width set on the table
|
|
223
222
|
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && node.attrs.displayMode === 'fixed') {
|
|
224
223
|
var _tableWidthPluginKey$;
|
|
@@ -336,7 +335,7 @@ export const createTableView = (node, view, getPos, portalProviderAPI, eventDisp
|
|
|
336
335
|
allowTableResizing,
|
|
337
336
|
allowTableAlignment
|
|
338
337
|
} = getPluginConfig(pluginConfig);
|
|
339
|
-
const isTableFixedColumnWidthsOptionEnabled =
|
|
338
|
+
const isTableFixedColumnWidthsOptionEnabled = allowFixedColumnWidthOption || false;
|
|
340
339
|
const shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
|
|
341
340
|
return new TableView({
|
|
342
341
|
node,
|
|
@@ -61,7 +61,7 @@ const tablePlugin = ({
|
|
|
61
61
|
config,
|
|
62
62
|
api
|
|
63
63
|
}) => {
|
|
64
|
-
var _config$tableOptions, _api$analytics, _options$getEditorFea
|
|
64
|
+
var _config$tableOptions, _api$analytics, _options$getEditorFea;
|
|
65
65
|
const editorViewRef = {
|
|
66
66
|
current: null
|
|
67
67
|
};
|
|
@@ -77,12 +77,12 @@ const tablePlugin = ({
|
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
80
|
-
const isTableFixedColumnWidthsOptionEnabled =
|
|
80
|
+
const isTableFixedColumnWidthsOptionEnabled = options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption;
|
|
81
81
|
const 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
|
|
82
82
|
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
83
83
|
const isTableSelectorEnabled =
|
|
84
84
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
85
|
-
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 ? void 0 : (_options$
|
|
85
|
+
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 ? void 0 : (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableSelector) && editorExperiment('platform_editor_controls', 'variant1');
|
|
86
86
|
if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
87
87
|
var _api$uiControlRegistr;
|
|
88
88
|
api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getTableMenuComponents({
|
|
@@ -230,15 +230,12 @@ const tablePlugin = ({
|
|
|
230
230
|
})
|
|
231
231
|
},
|
|
232
232
|
nodes() {
|
|
233
|
-
var _options$tableOptions2
|
|
233
|
+
var _options$tableOptions2;
|
|
234
234
|
const {
|
|
235
235
|
allowColumnResizing
|
|
236
236
|
} = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions);
|
|
237
237
|
// TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
|
|
238
238
|
const isNestingSupported = Boolean(options === null || options === void 0 ? void 0 : (_options$tableOptions2 = options.tableOptions) === null || _options$tableOptions2 === void 0 ? void 0 : _options$tableOptions2.allowNestedTables);
|
|
239
|
-
const isTableFixedColumnWidthsOptionEnabled = (fg('platform_editor_table_fixed_column_width_prop') ? options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption : options === null || options === void 0 ? void 0 : (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
240
|
-
const 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
|
|
241
|
-
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
242
239
|
const isTableScalingEnabled = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
243
240
|
const isCommentEditor = options === null || options === void 0 ? void 0 : options.isCommentEditor;
|
|
244
241
|
const isChromelessEditor = options === null || options === void 0 ? void 0 : options.isChromelessEditor;
|
|
@@ -307,7 +304,7 @@ const tablePlugin = ({
|
|
|
307
304
|
isChromelessEditor,
|
|
308
305
|
__livePage
|
|
309
306
|
} = options || {};
|
|
310
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor,
|
|
307
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableFixedColumnWidthsOptionEnabled, __livePage);
|
|
311
308
|
}
|
|
312
309
|
}, {
|
|
313
310
|
name: 'tablePMColResizing',
|
|
@@ -26,7 +26,6 @@ import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
|
26
26
|
import { isValidPosition } from '@atlaskit/editor-common/utils';
|
|
27
27
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
28
28
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
29
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
29
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
31
30
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
32
31
|
import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/commands';
|
|
@@ -602,7 +601,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
602
601
|
isResizing = _this$props9.isResizing,
|
|
603
602
|
view = _this$props9.view,
|
|
604
603
|
getPos = _this$props9.getPos,
|
|
605
|
-
getEditorFeatureFlags = _this$props9.getEditorFeatureFlags,
|
|
606
604
|
options = _this$props9.options;
|
|
607
605
|
if (!this.table) {
|
|
608
606
|
return;
|
|
@@ -633,7 +631,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
633
631
|
var isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged;
|
|
634
632
|
var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || this.state.windowResized;
|
|
635
633
|
if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
|
|
636
|
-
var _this$containerWidth2, _this$props0,
|
|
634
|
+
var _this$containerWidth2, _this$props0, _this$props$options3, _this$props$options4, _this$props$options5;
|
|
637
635
|
var isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
|
|
638
636
|
var wasTableResized = hasTableBeenResized(this.node);
|
|
639
637
|
var isTableResized = hasTableBeenResized(tableNode);
|
|
@@ -651,7 +649,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
651
649
|
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
652
650
|
isTableResized: isTableResized
|
|
653
651
|
});
|
|
654
|
-
var tableWithFixedColumnWidthsOption = (
|
|
652
|
+
var tableWithFixedColumnWidthsOption = ((_this$props0 = this.props) === null || _this$props0 === void 0 ? void 0 : _this$props0.allowFixedColumnWidthOption) || false;
|
|
655
653
|
var isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
|
|
656
654
|
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
|
|
657
655
|
if (force || !isResizing && shouldUpdateColgroup) {
|
|
@@ -716,7 +714,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
716
714
|
}, {
|
|
717
715
|
key: "componentDidUpdate",
|
|
718
716
|
value: function componentDidUpdate(_, prevState) {
|
|
719
|
-
var
|
|
717
|
+
var _this$props$options0, _this$props$options1;
|
|
720
718
|
var _this$props1 = this.props,
|
|
721
719
|
getNode = _this$props1.getNode,
|
|
722
720
|
isMediaFullscreen = _this$props1.isMediaFullscreen,
|
|
@@ -726,11 +724,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
726
724
|
options = _this$props1.options,
|
|
727
725
|
isTableScalingEnabled = _this$props1.isTableScalingEnabled,
|
|
728
726
|
getPos = _this$props1.getPos,
|
|
729
|
-
getEditorFeatureFlags = _this$props1.getEditorFeatureFlags,
|
|
730
727
|
allowFixedColumnWidthOption = _this$props1.allowFixedColumnWidthOption;
|
|
731
728
|
var shouldScale = false;
|
|
732
729
|
var shouldHandleColgroupUpdates = false;
|
|
733
|
-
var tableWithFixedColumnWidthsOption =
|
|
730
|
+
var tableWithFixedColumnWidthsOption = allowFixedColumnWidthOption || false;
|
|
734
731
|
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
735
732
|
shouldScale = true;
|
|
736
733
|
shouldHandleColgroupUpdates = true;
|
|
@@ -915,9 +912,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
915
912
|
tablePos = undefined;
|
|
916
913
|
}
|
|
917
914
|
var isNested = isTableNested(view.state, tablePos);
|
|
918
|
-
var
|
|
919
|
-
|
|
920
|
-
tableWithFixedColumnWidthsOption =
|
|
915
|
+
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
916
|
+
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
917
|
+
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag2 === void 0 ? false : _getEditorFeatureFlag2;
|
|
921
918
|
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$options12 = this.props.options) !== null && _this$props$options12 !== void 0 && _this$props$options12.isCommentEditor));
|
|
922
919
|
return /*#__PURE__*/React.createElement(TableContainer
|
|
923
920
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -19,7 +19,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
19
19
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
20
20
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
21
21
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
22
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
22
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
24
23
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
25
24
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
@@ -105,11 +104,11 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
105
104
|
}).toDOM(this.node);
|
|
106
105
|
var rendered = DOMSerializer.renderSpec(document, tableDOMStructure);
|
|
107
106
|
if (rendered.dom) {
|
|
108
|
-
var _this$reactComponentP5, _this$
|
|
107
|
+
var _this$reactComponentP5, _this$options, _this$options2;
|
|
109
108
|
var tableElement = rendered.dom.querySelector('table');
|
|
110
109
|
this.table = tableElement ? tableElement : rendered.dom;
|
|
111
110
|
this.renderedDOM = rendered.dom;
|
|
112
|
-
var allowFixedColumnWidthOption = (
|
|
111
|
+
var allowFixedColumnWidthOption = ((_this$reactComponentP5 = this.reactComponentProps) === null || _this$reactComponentP5 === void 0 ? void 0 : _this$reactComponentP5.allowFixedColumnWidthOption) || false;
|
|
113
112
|
if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && allowFixedColumnWidthOption && this.node.attrs.displayMode === 'fixed') {
|
|
114
113
|
var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos(), this.reactComponentProps.allowTableResizing);
|
|
115
114
|
if (tableInlineWidth) {
|
|
@@ -221,7 +220,6 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
221
220
|
_this$reactComponentP7,
|
|
222
221
|
_this3 = this,
|
|
223
222
|
_this$reactComponentP8,
|
|
224
|
-
_this$getEditorFeatur2,
|
|
225
223
|
_this$options3,
|
|
226
224
|
_this$options4;
|
|
227
225
|
if (!this.table) {
|
|
@@ -247,7 +245,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
247
245
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
248
246
|
_this3.table.setAttribute(attr, attrs[attr]);
|
|
249
247
|
});
|
|
250
|
-
var isTableFixedColumnWidthsOptionEnabled = (
|
|
248
|
+
var isTableFixedColumnWidthsOptionEnabled = ((_this$reactComponentP8 = this.reactComponentProps) === null || _this$reactComponentP8 === void 0 ? void 0 : _this$reactComponentP8.allowFixedColumnWidthOption) || false;
|
|
251
249
|
// Preserve Table Width cannot have inline width set on the table
|
|
252
250
|
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && node.attrs.displayMode === 'fixed') {
|
|
253
251
|
var _tableWidthPluginKey$;
|
|
@@ -371,7 +369,7 @@ export var createTableView = function createTableView(node, view, getPos, portal
|
|
|
371
369
|
allowControls = _getPluginConfig.allowControls,
|
|
372
370
|
allowTableResizing = _getPluginConfig.allowTableResizing,
|
|
373
371
|
allowTableAlignment = _getPluginConfig.allowTableAlignment;
|
|
374
|
-
var isTableFixedColumnWidthsOptionEnabled =
|
|
372
|
+
var isTableFixedColumnWidthsOptionEnabled = allowFixedColumnWidthOption || false;
|
|
375
373
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
|
|
376
374
|
return new TableView({
|
|
377
375
|
node: node,
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -63,7 +63,7 @@ var TABLE_WIDTH_INFO_TIMEOUT = 10000;
|
|
|
63
63
|
* from `@atlaskit/editor-core`.
|
|
64
64
|
*/
|
|
65
65
|
var tablePlugin = function tablePlugin(_ref) {
|
|
66
|
-
var _config$tableOptions, _api$analytics, _options$getEditorFea
|
|
66
|
+
var _config$tableOptions, _api$analytics, _options$getEditorFea;
|
|
67
67
|
var config = _ref.config,
|
|
68
68
|
api = _ref.api;
|
|
69
69
|
var editorViewRef = {
|
|
@@ -80,12 +80,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
83
|
-
var isTableFixedColumnWidthsOptionEnabled =
|
|
83
|
+
var isTableFixedColumnWidthsOptionEnabled = options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption;
|
|
84
84
|
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
|
|
85
85
|
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
86
86
|
var isTableSelectorEnabled =
|
|
87
87
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
88
|
-
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$
|
|
88
|
+
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableSelector) && editorExperiment('platform_editor_controls', 'variant1');
|
|
89
89
|
if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
90
90
|
var _api$uiControlRegistr;
|
|
91
91
|
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getTableMenuComponents({
|
|
@@ -235,14 +235,11 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
nodes: function nodes() {
|
|
238
|
-
var _options$tableOptions2
|
|
238
|
+
var _options$tableOptions2;
|
|
239
239
|
var _pluginConfig = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions),
|
|
240
240
|
allowColumnResizing = _pluginConfig.allowColumnResizing;
|
|
241
241
|
// TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
|
|
242
242
|
var isNestingSupported = Boolean(options === null || options === void 0 || (_options$tableOptions2 = options.tableOptions) === null || _options$tableOptions2 === void 0 ? void 0 : _options$tableOptions2.allowNestedTables);
|
|
243
|
-
var isTableFixedColumnWidthsOptionEnabled = (fg('platform_editor_table_fixed_column_width_prop') ? options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption : options === null || options === void 0 || (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
244
|
-
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
|
|
245
|
-
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
246
243
|
var isTableScalingEnabled = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
247
244
|
var isCommentEditor = options === null || options === void 0 ? void 0 : options.isCommentEditor;
|
|
248
245
|
var isChromelessEditor = options === null || options === void 0 ? void 0 : options.isChromelessEditor;
|
|
@@ -309,7 +306,7 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
309
306
|
isCommentEditor = _ref3.isCommentEditor,
|
|
310
307
|
isChromelessEditor = _ref3.isChromelessEditor,
|
|
311
308
|
__livePage = _ref3.__livePage;
|
|
312
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor,
|
|
309
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableFixedColumnWidthsOptionEnabled, __livePage);
|
|
313
310
|
}
|
|
314
311
|
}, {
|
|
315
312
|
name: 'tablePMColResizing',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^13.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^13.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^15.0.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "16.0.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "16.0.2",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^13.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^24.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^10.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.2.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^139.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^17.1.0",
|
|
58
58
|
"@atlaskit/tokens": "^16.3.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.0.0",
|
|
@@ -134,9 +134,6 @@
|
|
|
134
134
|
"platform_editor_enable_table_scaling": {
|
|
135
135
|
"type": "boolean"
|
|
136
136
|
},
|
|
137
|
-
"platform_editor_table_fixed_column_width_prop": {
|
|
138
|
-
"type": "boolean"
|
|
139
|
-
},
|
|
140
137
|
"platform_editor_table_nested_renderer_fix": {
|
|
141
138
|
"type": "boolean"
|
|
142
139
|
},
|