@atlaskit/editor-plugin-table 14.2.4 → 14.2.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 +16 -0
- package/dist/cjs/nodeviews/TableContainer.js +4 -1
- package/dist/cjs/nodeviews/TableResizer.js +3 -1
- package/dist/cjs/nodeviews/toDOM.js +4 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +4 -2
- package/dist/cjs/pm-plugins/utils/snapping.js +4 -2
- package/dist/cjs/ui/FloatingContextualMenu/index.js +18 -1
- package/dist/es2019/nodeviews/TableContainer.js +4 -1
- package/dist/es2019/nodeviews/TableResizer.js +3 -1
- package/dist/es2019/nodeviews/toDOM.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +4 -2
- package/dist/es2019/pm-plugins/utils/snapping.js +4 -2
- package/dist/es2019/ui/FloatingContextualMenu/index.js +18 -1
- package/dist/esm/nodeviews/TableContainer.js +4 -1
- package/dist/esm/nodeviews/TableResizer.js +3 -1
- package/dist/esm/nodeviews/toDOM.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +4 -2
- package/dist/esm/pm-plugins/utils/snapping.js +4 -2
- package/dist/esm/ui/FloatingContextualMenu/index.js +18 -1
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 14.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 14.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`6b6eca9cee16d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b6eca9cee16d) -
|
|
14
|
+
Switch to use editorExperiment to use productKey for responsive preview panel changes.
|
|
15
|
+
- [`07c4ed52fa008`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/07c4ed52fa008) -
|
|
16
|
+
Hydration fixes for table plugin
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 14.2.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
17
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
19
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
20
21
|
var _commandsWithAnalytics = require("../pm-plugins/commands/commands-with-analytics");
|
|
21
22
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
22
23
|
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
@@ -124,7 +125,9 @@ var selector = function selector(states) {
|
|
|
124
125
|
};
|
|
125
126
|
};
|
|
126
127
|
var getPadding = function getPadding(containerWidth) {
|
|
127
|
-
return containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0,
|
|
128
|
+
return containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
129
|
+
exposure: true
|
|
130
|
+
}) ? _editorSharedStyles.akEditorGutterPaddingReduced : (0, _editorSharedStyles.akEditorGutterPaddingDynamic)();
|
|
128
131
|
};
|
|
129
132
|
var ResizableTableContainerLegacy = /*#__PURE__*/_react.default.memo(function (_ref4) {
|
|
130
133
|
var children = _ref4.children,
|
|
@@ -81,7 +81,9 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
|
81
81
|
return minColumnWidth + 1;
|
|
82
82
|
};
|
|
83
83
|
var getPadding = function getPadding(containerWidth) {
|
|
84
|
-
return containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0,
|
|
84
|
+
return containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
85
|
+
exposure: true
|
|
86
|
+
}) ? _editorSharedStyles.akEditorGutterPaddingReduced : (0, _editorSharedStyles.akEditorGutterPaddingDynamic)();
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
/**
|
|
@@ -13,6 +13,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
13
13
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
17
18
|
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
18
19
|
var _misc = require("../pm-plugins/table-resizing/utils/misc");
|
|
@@ -25,7 +26,9 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
|
|
|
25
26
|
toDOM: function toDOM(node) {
|
|
26
27
|
var _node$attrs$width;
|
|
27
28
|
var gutterPadding = function gutterPadding() {
|
|
28
|
-
if ((0,
|
|
29
|
+
if ((0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
30
|
+
exposure: true
|
|
31
|
+
})) {
|
|
29
32
|
return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
|
|
30
33
|
} else {
|
|
31
34
|
return "".concat((0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2, "px");
|
|
@@ -11,7 +11,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var
|
|
14
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
15
|
var _colgroup = require("./colgroup");
|
|
16
16
|
var _consts = require("./consts");
|
|
17
17
|
// Translates named layouts in number values.
|
|
@@ -21,7 +21,9 @@ function getLayoutSize(tableLayout) {
|
|
|
21
21
|
var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
22
22
|
if (isFullWidthModeEnabled) {
|
|
23
23
|
var padding = (0, _editorSharedStyles.akEditorGutterPaddingDynamic)();
|
|
24
|
-
if (containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0,
|
|
24
|
+
if (containerWidth <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
25
|
+
exposure: true
|
|
26
|
+
})) {
|
|
25
27
|
padding = _editorSharedStyles.akEditorGutterPaddingReduced;
|
|
26
28
|
}
|
|
27
29
|
return containerWidth ? Math.min(containerWidth - padding * 2, _editorSharedStyles.akEditorFullWidthLayoutWidth) : _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
@@ -8,7 +8,7 @@ exports.findClosestSnap = exports.defaultTablePreserveSnappingWidths = exports.d
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _guideline = require("@atlaskit/editor-common/guideline");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
-
var
|
|
11
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
12
|
var numberOfLanesInDefaultLayoutWidth = 12;
|
|
13
13
|
var calculateSubSnappingWidths = function calculateSubSnappingWidths(totalLanes, totalWidth) {
|
|
14
14
|
return new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map(function (v, i) {
|
|
@@ -20,7 +20,9 @@ var calculateDefaultSnappings = exports.calculateDefaultSnappings = function cal
|
|
|
20
20
|
return [].concat((0, _toConsumableArray2.default)(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, _editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset)), [_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset, _editorSharedStyles.akEditorFullWidthLayoutWidth + lengthOffset]);
|
|
21
21
|
};
|
|
22
22
|
var getPadding = function getPadding(editorContainerWith) {
|
|
23
|
-
return editorContainerWith <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0,
|
|
23
|
+
return editorContainerWith <= _editorSharedStyles.akEditorFullPageNarrowBreakout && (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true, {
|
|
24
|
+
exposure: true
|
|
25
|
+
}) ? _editorSharedStyles.akEditorGutterPaddingReduced : (0, _editorSharedStyles.akEditorGutterPaddingDynamic)();
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
// FF TablePreserve for calculateDefaultSnappings
|
|
@@ -10,6 +10,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
14
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
14
15
|
var _consts = require("../consts");
|
|
15
16
|
var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
|
|
@@ -36,13 +37,24 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
36
37
|
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
|
|
37
38
|
isCommentEditor = _ref.isCommentEditor,
|
|
38
39
|
api = _ref.api;
|
|
40
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
45
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
40
47
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
41
48
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
42
49
|
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
50
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
43
52
|
if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
|
|
44
53
|
return null;
|
|
45
54
|
}
|
|
55
|
+
|
|
56
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
58
|
var selection = editorView.state.selection;
|
|
47
59
|
var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ?
|
|
48
60
|
// Ignored via go/ees005
|
|
@@ -51,6 +63,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
51
63
|
if (!selectionRect) {
|
|
52
64
|
return null;
|
|
53
65
|
}
|
|
66
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
54
68
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
55
69
|
var targetCellRef = (0, _utils.findDomRefAtPos)(targetCellPosition, domAtPos);
|
|
56
70
|
if (!targetCellRef) {
|
|
@@ -78,7 +92,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
78
92
|
stick: true
|
|
79
93
|
}, (0, _react.jsx)("div", {
|
|
80
94
|
css: (0, _styles.tablePopupStyles)(isDragAndDropEnabled)
|
|
81
|
-
}, (0, _react.jsx)(_ContextualMenu.default
|
|
95
|
+
}, (0, _react.jsx)(_ContextualMenu.default
|
|
96
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
98
|
+
, {
|
|
82
99
|
editorView: editorView,
|
|
83
100
|
offset: [_consts.contextualMenuTriggerSize / 2, -_consts.contextualMenuTriggerSize],
|
|
84
101
|
isOpen: isOpen,
|
|
@@ -8,6 +8,7 @@ import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutte
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
12
13
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
13
14
|
import { TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
@@ -118,7 +119,9 @@ const selector = states => ({
|
|
|
118
119
|
editorViewModeState: states.editorViewModeState
|
|
119
120
|
});
|
|
120
121
|
const getPadding = containerWidth => {
|
|
121
|
-
return containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
122
|
+
return containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
123
|
+
exposure: true
|
|
124
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
122
125
|
};
|
|
123
126
|
const ResizableTableContainerLegacy = /*#__PURE__*/React.memo(({
|
|
124
127
|
children,
|
|
@@ -68,7 +68,9 @@ const getResizerMinWidth = node => {
|
|
|
68
68
|
return minColumnWidth + 1;
|
|
69
69
|
};
|
|
70
70
|
const getPadding = containerWidth => {
|
|
71
|
-
return containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
71
|
+
return containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
72
|
+
exposure: true
|
|
73
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
/**
|
|
@@ -3,6 +3,7 @@ import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
4
4
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
import { generateColgroup, generateColgroupFromNode, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
7
8
|
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
|
|
8
9
|
import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS, getTableResizerItemWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
|
|
@@ -14,7 +15,9 @@ export const tableNodeSpecWithFixedToDOM = config => {
|
|
|
14
15
|
toDOM: node => {
|
|
15
16
|
var _node$attrs$width;
|
|
16
17
|
const gutterPadding = () => {
|
|
17
|
-
if (
|
|
18
|
+
if (editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
19
|
+
exposure: true
|
|
20
|
+
})) {
|
|
18
21
|
return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
|
|
19
22
|
} else {
|
|
20
23
|
return `${akEditorGutterPaddingDynamic() * 2}px`;
|
|
@@ -2,7 +2,7 @@ import { getParentNodeWidth, getTableContainerWidth, layoutToWidth } from '@atla
|
|
|
2
2
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { hasTableBeenResized, hasTableColumnBeenResized } from './colgroup';
|
|
7
7
|
import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION, TABLE_MAX_WIDTH } from './consts';
|
|
8
8
|
|
|
@@ -13,7 +13,9 @@ export function getLayoutSize(tableLayout, containerWidth = 0, options) {
|
|
|
13
13
|
} = options;
|
|
14
14
|
if (isFullWidthModeEnabled) {
|
|
15
15
|
let padding = akEditorGutterPaddingDynamic();
|
|
16
|
-
if (containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
16
|
+
if (containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
17
|
+
exposure: true
|
|
18
|
+
})) {
|
|
17
19
|
padding = akEditorGutterPaddingReduced;
|
|
18
20
|
}
|
|
19
21
|
return containerWidth ? Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth) : akEditorFullWidthLayoutWidth;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import {
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
4
|
const numberOfLanesInDefaultLayoutWidth = 12;
|
|
5
5
|
const calculateSubSnappingWidths = (totalLanes, totalWidth) => new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map((v, i) => v * (i + 1) * 2);
|
|
6
6
|
export const calculateDefaultSnappings = (lengthOffset = 0) => [...calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset), akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset];
|
|
7
7
|
const getPadding = editorContainerWith => {
|
|
8
|
-
return editorContainerWith <= akEditorFullPageNarrowBreakout &&
|
|
8
|
+
return editorContainerWith <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
9
|
+
exposure: true
|
|
10
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
// FF TablePreserve for calculateDefaultSnappings
|
|
@@ -8,6 +8,7 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
12
13
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
13
14
|
|
|
@@ -29,14 +30,25 @@ const FloatingContextualMenu = ({
|
|
|
29
30
|
isCommentEditor,
|
|
30
31
|
api
|
|
31
32
|
}) => {
|
|
33
|
+
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
38
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
33
40
|
const {
|
|
34
41
|
targetCellPosition,
|
|
35
42
|
isDragAndDropEnabled
|
|
36
43
|
} = getPluginState(editorView.state);
|
|
44
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
46
|
if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
|
|
38
47
|
return null;
|
|
39
48
|
}
|
|
49
|
+
|
|
50
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
40
52
|
const {
|
|
41
53
|
selection
|
|
42
54
|
} = editorView.state;
|
|
@@ -47,6 +59,8 @@ const FloatingContextualMenu = ({
|
|
|
47
59
|
if (!selectionRect) {
|
|
48
60
|
return null;
|
|
49
61
|
}
|
|
62
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
64
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
51
65
|
const targetCellRef = findDomRefAtPos(targetCellPosition, domAtPos);
|
|
52
66
|
if (!targetCellRef) {
|
|
@@ -74,7 +88,10 @@ const FloatingContextualMenu = ({
|
|
|
74
88
|
stick: true
|
|
75
89
|
}, jsx("div", {
|
|
76
90
|
css: tablePopupStyles(isDragAndDropEnabled)
|
|
77
|
-
}, jsx(ContextualMenu
|
|
91
|
+
}, jsx(ContextualMenu
|
|
92
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
94
|
+
, {
|
|
78
95
|
editorView: editorView,
|
|
79
96
|
offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
|
|
80
97
|
isOpen: isOpen,
|
|
@@ -9,6 +9,7 @@ import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutte
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
11
11
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
13
14
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
14
15
|
import { TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
@@ -115,7 +116,9 @@ var selector = function selector(states) {
|
|
|
115
116
|
};
|
|
116
117
|
};
|
|
117
118
|
var getPadding = function getPadding(containerWidth) {
|
|
118
|
-
return containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
119
|
+
return containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
120
|
+
exposure: true
|
|
121
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
119
122
|
};
|
|
120
123
|
var ResizableTableContainerLegacy = /*#__PURE__*/React.memo(function (_ref4) {
|
|
121
124
|
var children = _ref4.children,
|
|
@@ -72,7 +72,9 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
|
72
72
|
return minColumnWidth + 1;
|
|
73
73
|
};
|
|
74
74
|
var getPadding = function getPadding(containerWidth) {
|
|
75
|
-
return containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
75
|
+
return containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
76
|
+
exposure: true
|
|
77
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
76
78
|
};
|
|
77
79
|
|
|
78
80
|
/**
|
|
@@ -8,6 +8,7 @@ import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
|
|
|
8
8
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
9
9
|
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { generateColgroup, generateColgroupFromNode, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
12
13
|
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
|
|
13
14
|
import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS, getTableResizerItemWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
|
|
@@ -18,7 +19,9 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
|
|
|
18
19
|
toDOM: function toDOM(node) {
|
|
19
20
|
var _node$attrs$width;
|
|
20
21
|
var gutterPadding = function gutterPadding() {
|
|
21
|
-
if (
|
|
22
|
+
if (editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
23
|
+
exposure: true
|
|
24
|
+
})) {
|
|
22
25
|
return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
|
|
23
26
|
} else {
|
|
24
27
|
return "".concat(akEditorGutterPaddingDynamic() * 2, "px");
|
|
@@ -2,7 +2,7 @@ import { getParentNodeWidth, getTableContainerWidth, layoutToWidth } from '@atla
|
|
|
2
2
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
6
|
import { hasTableBeenResized, hasTableColumnBeenResized } from './colgroup';
|
|
7
7
|
import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION, TABLE_MAX_WIDTH } from './consts';
|
|
8
8
|
|
|
@@ -13,7 +13,9 @@ export function getLayoutSize(tableLayout) {
|
|
|
13
13
|
var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
14
14
|
if (isFullWidthModeEnabled) {
|
|
15
15
|
var padding = akEditorGutterPaddingDynamic();
|
|
16
|
-
if (containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
16
|
+
if (containerWidth <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
17
|
+
exposure: true
|
|
18
|
+
})) {
|
|
17
19
|
padding = akEditorGutterPaddingReduced;
|
|
18
20
|
}
|
|
19
21
|
return containerWidth ? Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth) : akEditorFullWidthLayoutWidth;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
|
|
3
3
|
import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
5
|
var numberOfLanesInDefaultLayoutWidth = 12;
|
|
6
6
|
var calculateSubSnappingWidths = function calculateSubSnappingWidths(totalLanes, totalWidth) {
|
|
7
7
|
return new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map(function (v, i) {
|
|
@@ -13,7 +13,9 @@ export var calculateDefaultSnappings = function calculateDefaultSnappings() {
|
|
|
13
13
|
return [].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset)), [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset]);
|
|
14
14
|
};
|
|
15
15
|
var getPadding = function getPadding(editorContainerWith) {
|
|
16
|
-
return editorContainerWith <= akEditorFullPageNarrowBreakout &&
|
|
16
|
+
return editorContainerWith <= akEditorFullPageNarrowBreakout && editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
17
|
+
exposure: true
|
|
18
|
+
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
// FF TablePreserve for calculateDefaultSnappings
|
|
@@ -8,6 +8,7 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
12
13
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
13
14
|
|
|
@@ -28,13 +29,24 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
28
29
|
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
|
|
29
30
|
isCommentEditor = _ref.isCommentEditor,
|
|
30
31
|
api = _ref.api;
|
|
32
|
+
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
37
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
39
|
var _getPluginState = getPluginState(editorView.state),
|
|
33
40
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
34
41
|
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
42
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
35
44
|
if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
|
|
36
45
|
return null;
|
|
37
46
|
}
|
|
47
|
+
|
|
48
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
38
50
|
var selection = editorView.state.selection;
|
|
39
51
|
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
40
52
|
// Ignored via go/ees005
|
|
@@ -43,6 +55,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
43
55
|
if (!selectionRect) {
|
|
44
56
|
return null;
|
|
45
57
|
}
|
|
58
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
60
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
47
61
|
var targetCellRef = findDomRefAtPos(targetCellPosition, domAtPos);
|
|
48
62
|
if (!targetCellRef) {
|
|
@@ -70,7 +84,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
70
84
|
stick: true
|
|
71
85
|
}, jsx("div", {
|
|
72
86
|
css: tablePopupStyles(isDragAndDropEnabled)
|
|
73
|
-
}, jsx(ContextualMenu
|
|
87
|
+
}, jsx(ContextualMenu
|
|
88
|
+
// Remove ! during platform_editor_hydratable_ui cleanup
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
90
|
+
, {
|
|
74
91
|
editorView: editorView,
|
|
75
92
|
offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
|
|
76
93
|
isOpen: isOpen,
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
api: PluginInjectionAPI | undefined | null;
|
|
12
12
|
boundariesElement?: HTMLElement;
|
|
13
13
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
14
|
-
editorView: EditorView;
|
|
14
|
+
editorView: EditorView | undefined;
|
|
15
15
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
16
16
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
17
17
|
isCellMenuOpenByKeyboard?: boolean;
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
api: PluginInjectionAPI | undefined | null;
|
|
12
12
|
boundariesElement?: HTMLElement;
|
|
13
13
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
14
|
-
editorView: EditorView;
|
|
14
|
+
editorView: EditorView | undefined;
|
|
15
15
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
16
16
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
17
17
|
isCellMenuOpenByKeyboard?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.6",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^5.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^5.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "8.2.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "8.2.2",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^5.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^7.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^2.1.0",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
58
58
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
59
|
-
"@atlaskit/primitives": "^14.
|
|
59
|
+
"@atlaskit/primitives": "^14.15.0",
|
|
60
60
|
"@atlaskit/react-ufo": "^4.7.0",
|
|
61
61
|
"@atlaskit/theme": "^21.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^12.26.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.1.0",
|
|
64
64
|
"@atlaskit/tokens": "^6.3.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.4.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^109.
|
|
75
|
+
"@atlaskit/editor-common": "^109.11.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-dom": "^18.2.0",
|
|
78
78
|
"react-intl-next": "npm:react-intl@^5.18.1"
|