@atlaskit/editor-plugin-table 15.3.10 → 15.3.12
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 +19 -0
- package/dist/cjs/nodeviews/TableComponentLegacy.js +6 -3
- package/dist/cjs/nodeviews/TableComponentNext.js +6 -3
- package/dist/cjs/pm-plugins/commands/insert.js +5 -5
- package/dist/cjs/pm-plugins/main.js +2 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +22 -11
- package/dist/cjs/pm-plugins/utils/decoration.js +3 -0
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +2 -1
- package/dist/cjs/ui/ContentComponent.js +3 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +14 -3
- package/dist/cjs/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +1 -1
- package/dist/cjs/ui/toolbar.js +1 -1
- package/dist/es2019/nodeviews/TableComponentLegacy.js +6 -3
- package/dist/es2019/nodeviews/TableComponentNext.js +6 -3
- package/dist/es2019/pm-plugins/commands/insert.js +6 -6
- package/dist/es2019/pm-plugins/main.js +2 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +20 -11
- package/dist/es2019/pm-plugins/utils/decoration.js +2 -0
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +2 -0
- package/dist/es2019/ui/ContentComponent.js +3 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +11 -1
- package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +1 -1
- package/dist/es2019/ui/toolbar.js +2 -2
- package/dist/esm/nodeviews/TableComponentLegacy.js +6 -3
- package/dist/esm/nodeviews/TableComponentNext.js +6 -3
- package/dist/esm/pm-plugins/commands/insert.js +6 -6
- package/dist/esm/pm-plugins/main.js +2 -1
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +22 -11
- package/dist/esm/pm-plugins/utils/decoration.js +2 -0
- package/dist/esm/pm-plugins/view-mode-sort/index.js +2 -0
- package/dist/esm/ui/ContentComponent.js +3 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +14 -3
- package/dist/esm/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +1 -1
- package/dist/esm/ui/toolbar.js +2 -2
- package/dist/types/pm-plugins/commands/insert.d.ts +4 -4
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -0
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/commands/insert.d.ts +4 -4
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -0
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +2 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 15.3.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c094becfaeeaa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c094becfaeeaa) -
|
|
8
|
+
EDITOR-2476 Introduce new utility method to check if nested tables is supported in the schema to
|
|
9
|
+
facilitate removal of gate `platform_editor_use_nested_table_pm_nodes`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 15.3.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`e3336879840a4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3336879840a4) -
|
|
17
|
+
[ux] EDITOR-2620 Toggle contextual menu when drag menu is opened
|
|
18
|
+
- [`8b2c7333efccd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8b2c7333efccd) -
|
|
19
|
+
fix table width css used for table scaling
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 15.3.10
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -693,7 +693,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
693
693
|
isTableDisplayModeChanged: isTableDisplayModeChanged,
|
|
694
694
|
isNumberColumnChanged: isNumberColumnChanged,
|
|
695
695
|
isNumberOfColumnsChanged: isNumberOfColumnsChanged,
|
|
696
|
-
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged
|
|
696
|
+
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
697
|
+
isTableResized: isTableResized
|
|
697
698
|
});
|
|
698
699
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
699
700
|
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
@@ -794,8 +795,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
794
795
|
shouldScale = true;
|
|
795
796
|
shouldHandleColgroupUpdates = true;
|
|
796
797
|
}
|
|
797
|
-
if (
|
|
798
|
-
|
|
798
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_table_width_refactor')) {
|
|
799
|
+
if (this.state.windowResized) {
|
|
800
|
+
shouldHandleColgroupUpdates = true;
|
|
801
|
+
}
|
|
799
802
|
}
|
|
800
803
|
if (shouldHandleColgroupUpdates) {
|
|
801
804
|
this.handleColgroupUpdates();
|
|
@@ -627,7 +627,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
627
627
|
isTableDisplayModeChanged: isTableDisplayModeChanged,
|
|
628
628
|
isNumberColumnChanged: isNumberColumnChanged,
|
|
629
629
|
isNumberOfColumnsChanged: isNumberOfColumnsChanged,
|
|
630
|
-
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged
|
|
630
|
+
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
631
|
+
isTableResized: isTableResized
|
|
631
632
|
});
|
|
632
633
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
633
634
|
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
@@ -725,8 +726,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
725
726
|
shouldScale = true;
|
|
726
727
|
shouldHandleColgroupUpdates = true;
|
|
727
728
|
}
|
|
728
|
-
if (
|
|
729
|
-
|
|
729
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_table_width_refactor')) {
|
|
730
|
+
if (this.state.windowResized) {
|
|
731
|
+
shouldHandleColgroupUpdates = true;
|
|
732
|
+
}
|
|
730
733
|
}
|
|
731
734
|
if (shouldHandleColgroupUpdates) {
|
|
732
735
|
this.handleColgroupUpdates();
|
|
@@ -234,16 +234,16 @@ var insertTableWithSize = exports.insertTableWithSize = function insertTableWith
|
|
|
234
234
|
/**
|
|
235
235
|
* Unified command to insert a new table into the editor.
|
|
236
236
|
*
|
|
237
|
-
* @param {
|
|
237
|
+
* @param {object} options - Configuration options for table insertion.
|
|
238
238
|
* @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
|
|
239
239
|
* @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
|
|
240
240
|
* @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
|
|
241
241
|
* @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
|
|
242
242
|
* @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
|
|
243
243
|
* @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
|
|
244
|
-
* @param {
|
|
245
|
-
* @param {
|
|
246
|
-
* @param {
|
|
244
|
+
* @param {object} [options.createTableProps={}] - Additional properties for table creation, including table size.
|
|
245
|
+
* @param {object} api - PluginInjectinoApi object for content insertion commands.
|
|
246
|
+
* @param {object} analyticsPayload - Payload for analytics tracking.
|
|
247
247
|
*
|
|
248
248
|
* @returns {Function} A function that takes a transaction and inserts a table.
|
|
249
249
|
*/
|
|
@@ -270,7 +270,7 @@ var insertTableWithNestingSupport = exports.insertTableWithNestingSupport = func
|
|
|
270
270
|
// If the cursor is inside a table
|
|
271
271
|
var insertAt;
|
|
272
272
|
var isNestedTable = false;
|
|
273
|
-
if ((0, _utils.hasParentNodeOfType)(schema.nodes.table)(tr.selection) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
|
|
273
|
+
if ((0, _utils.hasParentNodeOfType)(schema.nodes.table)(tr.selection) && (0, _nesting.isNestedTablesSupported)(schema) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
|
|
274
274
|
// If the experiment is disabled, or we're trying to nest deeper than one level, we insert the table after the top table
|
|
275
275
|
if ((0, _experiments.editorExperiment)('nested-tables-in-tables', false, {
|
|
276
276
|
exposure: true
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
11
11
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
12
|
+
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
12
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
14
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
14
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -245,7 +246,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
245
246
|
slice = (0, _misc.transformSliceToFixDarkModeDefaultBackgroundColor)(slice, schema);
|
|
246
247
|
}
|
|
247
248
|
slice = (0, _transforms.transformSliceToRemoveOpenNestedExpand)(slice, schema);
|
|
248
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
|
|
249
|
+
if ((0, _nesting.isNestedTablesSupported)(schema) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
|
|
249
250
|
slice = (0, _paste.transformSliceToRemoveNestedTables)(slice, schema, editorState.selection);
|
|
250
251
|
}
|
|
251
252
|
return slice;
|
|
@@ -11,6 +11,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
13
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _consts = require("./consts");
|
|
15
16
|
var _misc = require("./misc");
|
|
16
17
|
/**
|
|
@@ -76,17 +77,27 @@ var generateColgroupFromNode = exports.generateColgroupFromNode = function gener
|
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
} else {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
if (!isTableScalingEnabled && (0, _platformFeatureFlags.fg)('platform_editor_table_width_refactor')) {
|
|
81
|
+
cols.push.apply(cols, (0, _toConsumableArray2.default)(Array.from({
|
|
82
|
+
length: colspan
|
|
83
|
+
}, function (_) {
|
|
84
|
+
return ['col', {
|
|
85
|
+
style: "width: ".concat(_styles.tableCellMinWidth, "px;")
|
|
86
|
+
}];
|
|
87
|
+
})));
|
|
88
|
+
} else {
|
|
89
|
+
// columns has not been resized, so distribute the width evenly
|
|
90
|
+
cols.push.apply(cols, (0, _toConsumableArray2.default)(Array.from({
|
|
91
|
+
length: colspan
|
|
92
|
+
}, function (_) {
|
|
93
|
+
var tableWidth = (0, _misc.getTableContainerElementWidth)(table);
|
|
94
|
+
var columnWidth = tableWidth / map.width || 0;
|
|
95
|
+
var fixedColWidth = getColWidthFix(columnWidth, map.width || 0);
|
|
96
|
+
return ['col', {
|
|
97
|
+
style: generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth)
|
|
98
|
+
}];
|
|
99
|
+
})));
|
|
100
|
+
}
|
|
90
101
|
}
|
|
91
102
|
});
|
|
92
103
|
return cols;
|
|
@@ -15,6 +15,8 @@ var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
16
16
|
var _types = require("../../types");
|
|
17
17
|
var _ColumnResizeWidget = require("../../ui/ColumnResizeWidget");
|
|
18
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
19
|
+
|
|
18
20
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
19
21
|
|
|
20
22
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
@@ -268,6 +270,7 @@ var createResizeHandleDecoration = exports.createResizeHandleDecoration = functi
|
|
|
268
270
|
return emptyResult;
|
|
269
271
|
}
|
|
270
272
|
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) {
|
|
273
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
271
274
|
var decorationRenderKey = (0, _v.default)();
|
|
272
275
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
273
276
|
return _view.Decoration.widget(position, function () {
|
|
@@ -28,7 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
28
28
|
* This plugin allows sorting of table nodes in the Editor without modifying the underlying ProseMirror document.
|
|
29
29
|
* Instead of making changes to the ProseMirror document, the plugin sorts the table rows in the DOM. This allows the sorting to be
|
|
30
30
|
* visible to the user without affecting the document's content.
|
|
31
|
-
*/
|
|
31
|
+
*/ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
32
32
|
var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPortalProviderAPI) {
|
|
33
33
|
return new _safePlugin.SafePlugin({
|
|
34
34
|
state: {
|
|
@@ -111,6 +111,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
|
|
|
111
111
|
var map = _tableMap.TableMap.get(tableNode);
|
|
112
112
|
var hasMergedCells = new Set(map.map).size !== map.map.length;
|
|
113
113
|
map.mapByRow[0].forEach(function (cell, index) {
|
|
114
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
114
115
|
var decorationRenderKey = (0, _v.default)();
|
|
115
116
|
decs.push(_view.Decoration.widget(cell + pos + 2, function () {
|
|
116
117
|
var _sort$tableId;
|
|
@@ -13,6 +13,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
13
13
|
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
16
17
|
var _FloatingContextualButton = _interopRequireDefault(require("./FloatingContextualButton"));
|
|
17
18
|
var _FloatingContextualMenu = _interopRequireDefault(require("./FloatingContextualMenu"));
|
|
18
19
|
var _FloatingDeleteButton = _interopRequireDefault(require("./FloatingDeleteButton"));
|
|
@@ -145,7 +146,8 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
145
146
|
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
146
147
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
147
148
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
148
|
-
api: api
|
|
149
|
+
api: api,
|
|
150
|
+
isDragMenuOpen: isDragAndDropEnabled && (0, _expVal.expValNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
149
151
|
}), isDragAndDropEnabled && /*#__PURE__*/_react.default.createElement(_FloatingDragMenu.default, {
|
|
150
152
|
editorView: editorView,
|
|
151
153
|
mountPoint: popupsMountPoint,
|
|
@@ -43,6 +43,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
43
43
|
var _primitives = require("@atlaskit/primitives");
|
|
44
44
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
45
45
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
46
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
46
47
|
var _commands = require("../../pm-plugins/commands");
|
|
47
48
|
var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
|
|
48
49
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
@@ -748,6 +749,16 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
748
749
|
}));
|
|
749
750
|
}
|
|
750
751
|
}
|
|
752
|
+
}, {
|
|
753
|
+
key: "componentDidUpdate",
|
|
754
|
+
value: function componentDidUpdate() {
|
|
755
|
+
var _getPluginState11 = (0, _pluginFactory.getPluginState)(this.props.editorView.state),
|
|
756
|
+
isDragAndDropEnabled = _getPluginState11.isDragAndDropEnabled,
|
|
757
|
+
isContextualMenuOpen = _getPluginState11.isContextualMenuOpen;
|
|
758
|
+
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen && (0, _expVal.expValNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
759
|
+
(0, _commands.toggleContextualMenu)()(this.props.editorView.state, this.props.editorView.dispatch);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
751
762
|
}, {
|
|
752
763
|
key: "render",
|
|
753
764
|
value: function render() {
|
|
@@ -760,8 +771,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
760
771
|
editorView = _this$props13.editorView,
|
|
761
772
|
isCellMenuOpenByKeyboard = _this$props13.isCellMenuOpenByKeyboard,
|
|
762
773
|
api = _this$props13.api;
|
|
763
|
-
var
|
|
764
|
-
isDragAndDropEnabled =
|
|
774
|
+
var _getPluginState12 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
775
|
+
isDragAndDropEnabled = _getPluginState12.isDragAndDropEnabled;
|
|
765
776
|
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
766
777
|
var isOpenAllowed = false;
|
|
767
778
|
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
@@ -802,7 +813,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
802
813
|
};
|
|
803
814
|
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
804
815
|
return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
805
|
-
userIntent: "
|
|
816
|
+
userIntent: "tableContextualMenuPopupOpen",
|
|
806
817
|
api: api
|
|
807
818
|
}, popupContent());
|
|
808
819
|
}
|
|
@@ -12,6 +12,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
12
12
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
15
16
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
16
17
|
var _consts = require("../consts");
|
|
17
18
|
var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
|
|
@@ -37,6 +38,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
37
38
|
getEditorFeatureFlags = _ref.getEditorFeatureFlags,
|
|
38
39
|
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
|
|
39
40
|
isCommentEditor = _ref.isCommentEditor,
|
|
41
|
+
isDragMenuOpen = _ref.isDragMenuOpen,
|
|
40
42
|
api = _ref.api;
|
|
41
43
|
if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
42
44
|
return null;
|
|
@@ -118,7 +120,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
118
120
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
119
121
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
120
122
|
isCommentEditor: isCommentEditor,
|
|
121
|
-
api: api
|
|
123
|
+
api: api,
|
|
124
|
+
isDragMenuOpen: (0, _expVal.expValNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
122
125
|
})));
|
|
123
126
|
};
|
|
124
127
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -561,7 +561,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
561
561
|
});
|
|
562
562
|
return isToolbarAIFCEnabled || (0, _expValEquals.expValEquals)('platform_editor_lovability_user_intent', 'isEnabled', true) ? (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
563
563
|
api: api,
|
|
564
|
-
userIntent: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? '
|
|
564
|
+
userIntent: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? 'tableDragMenuPopupOpen' : undefined
|
|
565
565
|
}, Menu) : Menu;
|
|
566
566
|
});
|
|
567
567
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(DragMenu);
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -488,7 +488,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
488
488
|
onBlur: (0, _commands.clearHoverSelection)()
|
|
489
489
|
}]
|
|
490
490
|
};
|
|
491
|
-
var isNestedTable = (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes') && (0, _nesting.isSelectionTableNestedInTable)(state);
|
|
491
|
+
var isNestedTable = (0, _nesting.isNestedTablesSupported)(state.schema) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes') && (0, _nesting.isSelectionTableNestedInTable)(state);
|
|
492
492
|
var hoverTableProps = function hoverTableProps(isInDanger, isSelected) {
|
|
493
493
|
return {
|
|
494
494
|
onMouseEnter: (0, _commands.hoverTable)(isInDanger, isSelected),
|
|
@@ -664,7 +664,8 @@ class TableComponent extends React.Component {
|
|
|
664
664
|
isTableDisplayModeChanged,
|
|
665
665
|
isNumberColumnChanged,
|
|
666
666
|
isNumberOfColumnsChanged,
|
|
667
|
-
isFullWidthModeAndLineLengthChanged
|
|
667
|
+
isFullWidthModeAndLineLengthChanged,
|
|
668
|
+
isTableResized
|
|
668
669
|
});
|
|
669
670
|
const {
|
|
670
671
|
tableWithFixedColumnWidthsOption = false
|
|
@@ -762,8 +763,10 @@ class TableComponent extends React.Component {
|
|
|
762
763
|
shouldScale = true;
|
|
763
764
|
shouldHandleColgroupUpdates = true;
|
|
764
765
|
}
|
|
765
|
-
if (
|
|
766
|
-
|
|
766
|
+
if (!fg('platform_editor_table_width_refactor')) {
|
|
767
|
+
if (this.state.windowResized) {
|
|
768
|
+
shouldHandleColgroupUpdates = true;
|
|
769
|
+
}
|
|
767
770
|
}
|
|
768
771
|
if (shouldHandleColgroupUpdates) {
|
|
769
772
|
this.handleColgroupUpdates();
|
|
@@ -588,7 +588,8 @@ class TableComponent extends React.Component {
|
|
|
588
588
|
isTableDisplayModeChanged,
|
|
589
589
|
isNumberColumnChanged,
|
|
590
590
|
isNumberOfColumnsChanged,
|
|
591
|
-
isFullWidthModeAndLineLengthChanged
|
|
591
|
+
isFullWidthModeAndLineLengthChanged,
|
|
592
|
+
isTableResized
|
|
592
593
|
});
|
|
593
594
|
const {
|
|
594
595
|
tableWithFixedColumnWidthsOption = false
|
|
@@ -686,8 +687,10 @@ class TableComponent extends React.Component {
|
|
|
686
687
|
shouldScale = true;
|
|
687
688
|
shouldHandleColgroupUpdates = true;
|
|
688
689
|
}
|
|
689
|
-
if (
|
|
690
|
-
|
|
690
|
+
if (!fg('platform_editor_table_width_refactor')) {
|
|
691
|
+
if (this.state.windowResized) {
|
|
692
|
+
shouldHandleColgroupUpdates = true;
|
|
693
|
+
}
|
|
691
694
|
}
|
|
692
695
|
if (shouldHandleColgroupUpdates) {
|
|
693
696
|
this.handleColgroupUpdates();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { AddColumnStep } from '@atlaskit/custom-steps';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
4
|
+
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
5
5
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -198,16 +198,16 @@ export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnable
|
|
|
198
198
|
/**
|
|
199
199
|
* Unified command to insert a new table into the editor.
|
|
200
200
|
*
|
|
201
|
-
* @param {
|
|
201
|
+
* @param {object} options - Configuration options for table insertion.
|
|
202
202
|
* @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
|
|
203
203
|
* @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
|
|
204
204
|
* @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
|
|
205
205
|
* @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
|
|
206
206
|
* @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
|
|
207
207
|
* @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
|
|
208
|
-
* @param {
|
|
209
|
-
* @param {
|
|
210
|
-
* @param {
|
|
208
|
+
* @param {object} [options.createTableProps={}] - Additional properties for table creation, including table size.
|
|
209
|
+
* @param {object} api - PluginInjectinoApi object for content insertion commands.
|
|
210
|
+
* @param {object} analyticsPayload - Payload for analytics tracking.
|
|
211
211
|
*
|
|
212
212
|
* @returns {Function} A function that takes a transaction and inserts a table.
|
|
213
213
|
*/
|
|
@@ -230,7 +230,7 @@ export const insertTableWithNestingSupport = ({
|
|
|
230
230
|
// If the cursor is inside a table
|
|
231
231
|
let insertAt;
|
|
232
232
|
let isNestedTable = false;
|
|
233
|
-
if (hasParentNodeOfType(schema.nodes.table)(tr.selection) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
233
|
+
if (hasParentNodeOfType(schema.nodes.table)(tr.selection) && isNestedTablesSupported(schema) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
234
234
|
// If the experiment is disabled, or we're trying to nest deeper than one level, we insert the table after the top table
|
|
235
235
|
if (editorExperiment('nested-tables-in-tables', false, {
|
|
236
236
|
exposure: true
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
4
|
+
import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
4
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
6
|
import { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenLayoutNodes, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveOpenNestedExpand } from '@atlaskit/editor-common/transforms';
|
|
6
7
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
@@ -237,7 +238,7 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
|
|
|
237
238
|
slice = transformSliceToFixDarkModeDefaultBackgroundColor(slice, schema);
|
|
238
239
|
}
|
|
239
240
|
slice = transformSliceToRemoveOpenNestedExpand(slice, schema);
|
|
240
|
-
if (fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
241
|
+
if (isNestedTablesSupported(schema) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
241
242
|
slice = transformSliceToRemoveNestedTables(slice, schema, editorState.selection);
|
|
242
243
|
}
|
|
243
244
|
return slice;
|
|
@@ -3,6 +3,7 @@ import { calcTableColumnWidths, getFragmentBackingArray } from '@atlaskit/editor
|
|
|
3
3
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { COLUMN_MIN_WIDTH, MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
|
|
7
8
|
import { getScalingPercentForTableWithoutWidth, getTableContainerElementWidth, getTableScalingPercent } from './misc';
|
|
8
9
|
/**
|
|
@@ -64,17 +65,25 @@ export const generateColgroupFromNode = (table, isCommentEditor, isChromelessEdi
|
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
} else {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
if (!isTableScalingEnabled && fg('platform_editor_table_width_refactor')) {
|
|
69
|
+
cols.push(...Array.from({
|
|
70
|
+
length: colspan
|
|
71
|
+
}, _ => ['col', {
|
|
72
|
+
style: `width: ${tableCellMinWidth}px;`
|
|
73
|
+
}]));
|
|
74
|
+
} else {
|
|
75
|
+
// columns has not been resized, so distribute the width evenly
|
|
76
|
+
cols.push(...Array.from({
|
|
77
|
+
length: colspan
|
|
78
|
+
}, _ => {
|
|
79
|
+
const tableWidth = getTableContainerElementWidth(table);
|
|
80
|
+
const columnWidth = tableWidth / map.width || 0;
|
|
81
|
+
const fixedColWidth = getColWidthFix(columnWidth, map.width || 0);
|
|
82
|
+
return ['col', {
|
|
83
|
+
style: generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth)
|
|
84
|
+
}];
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
78
87
|
}
|
|
79
88
|
});
|
|
80
89
|
return cols;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
2
|
import { RawIntlProvider } from 'react-intl-next';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
3
4
|
import uuid from 'uuid/v4';
|
|
4
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
5
6
|
|
|
@@ -238,6 +239,7 @@ export const createResizeHandleDecoration = (tr, rowIndexTarget, columnEndIndexT
|
|
|
238
239
|
return emptyResult;
|
|
239
240
|
}
|
|
240
241
|
const createResizerHandleDecoration = (cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) => {
|
|
242
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
241
243
|
const decorationRenderKey = uuid();
|
|
242
244
|
const position = cellPos + cellNode.nodeSize - 1;
|
|
243
245
|
return Decoration.widget(position, () => {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { createElement } from 'react';
|
|
8
8
|
import { RawIntlProvider } from 'react-intl-next';
|
|
9
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
9
10
|
import uuid from 'uuid/v4';
|
|
10
11
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
12
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
@@ -84,6 +85,7 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
|
|
|
84
85
|
const map = TableMap.get(tableNode);
|
|
85
86
|
const hasMergedCells = new Set(map.map).size !== map.map.length;
|
|
86
87
|
map.mapByRow[0].forEach((cell, index) => {
|
|
88
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
87
89
|
const decorationRenderKey = uuid();
|
|
88
90
|
decs.push(Decoration.widget(cell + pos + 2, () => {
|
|
89
91
|
var _sort$tableId;
|
|
@@ -6,6 +6,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
6
6
|
import { ResizerBreakoutModeLabel } from '@atlaskit/editor-common/resizer';
|
|
7
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
9
10
|
import FloatingContextualButton from './FloatingContextualButton';
|
|
10
11
|
import FloatingContextualMenu from './FloatingContextualMenu';
|
|
11
12
|
import FloatingDeleteButton from './FloatingDeleteButton';
|
|
@@ -140,7 +141,8 @@ const ContentComponentInternal = ({
|
|
|
140
141
|
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
141
142
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
142
143
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
143
|
-
api: api
|
|
144
|
+
api: api,
|
|
145
|
+
isDragMenuOpen: isDragAndDropEnabled && expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
144
146
|
}), isDragAndDropEnabled && /*#__PURE__*/React.createElement(FloatingDragMenu, {
|
|
145
147
|
editorView: editorView,
|
|
146
148
|
mountPoint: popupsMountPoint,
|
|
@@ -36,6 +36,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
36
36
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
37
37
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
38
38
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
39
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
39
40
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
40
41
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
41
42
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
@@ -807,6 +808,15 @@ export class ContextualMenu extends Component {
|
|
|
807
808
|
});
|
|
808
809
|
}
|
|
809
810
|
}
|
|
811
|
+
componentDidUpdate() {
|
|
812
|
+
const {
|
|
813
|
+
isDragAndDropEnabled,
|
|
814
|
+
isContextualMenuOpen
|
|
815
|
+
} = getPluginState(this.props.editorView.state);
|
|
816
|
+
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen && expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
817
|
+
toggleContextualMenu()(this.props.editorView.state, this.props.editorView.dispatch);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
810
820
|
render() {
|
|
811
821
|
const {
|
|
812
822
|
isOpen,
|
|
@@ -858,7 +868,7 @@ export class ContextualMenu extends Component {
|
|
|
858
868
|
}));
|
|
859
869
|
if (expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
860
870
|
return jsx(UserIntentPopupWrapper, {
|
|
861
|
-
userIntent: "
|
|
871
|
+
userIntent: "tableContextualMenuPopupOpen",
|
|
862
872
|
api: api
|
|
863
873
|
}, popupContent());
|
|
864
874
|
}
|
|
@@ -10,6 +10,7 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
13
14
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
14
15
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
15
16
|
|
|
@@ -29,6 +30,7 @@ const FloatingContextualMenu = ({
|
|
|
29
30
|
getEditorFeatureFlags,
|
|
30
31
|
isCellMenuOpenByKeyboard,
|
|
31
32
|
isCommentEditor,
|
|
33
|
+
isDragMenuOpen,
|
|
32
34
|
api
|
|
33
35
|
}) => {
|
|
34
36
|
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
@@ -114,7 +116,8 @@ const FloatingContextualMenu = ({
|
|
|
114
116
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
115
117
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
116
118
|
isCommentEditor: isCommentEditor,
|
|
117
|
-
api: api
|
|
119
|
+
api: api,
|
|
120
|
+
isDragMenuOpen: expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
118
121
|
})));
|
|
119
122
|
};
|
|
120
123
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -560,7 +560,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
560
560
|
});
|
|
561
561
|
return isToolbarAIFCEnabled || expValEquals('platform_editor_lovability_user_intent', 'isEnabled', true) ? jsx(UserIntentPopupWrapper, {
|
|
562
562
|
api: api,
|
|
563
|
-
userIntent: expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? '
|
|
563
|
+
userIntent: expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? 'tableDragMenuPopupOpen' : undefined
|
|
564
564
|
}, Menu) : Menu;
|
|
565
565
|
});
|
|
566
566
|
export default injectIntl(DragMenu);
|
|
@@ -10,7 +10,7 @@ import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/a
|
|
|
10
10
|
import { DropdownMenuExtensionItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
11
11
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
12
12
|
import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
|
-
import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
13
|
+
import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
14
14
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
15
15
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
16
16
|
import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -460,7 +460,7 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
|
|
|
460
460
|
onBlur: clearHoverSelection()
|
|
461
461
|
}]
|
|
462
462
|
};
|
|
463
|
-
const isNestedTable = fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(state);
|
|
463
|
+
const isNestedTable = isNestedTablesSupported(state.schema) && fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(state);
|
|
464
464
|
const hoverTableProps = (isInDanger, isSelected) => ({
|
|
465
465
|
onMouseEnter: hoverTable(isInDanger, isSelected),
|
|
466
466
|
onMouseLeave: clearHoverSelection(),
|
|
@@ -687,7 +687,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
687
687
|
isTableDisplayModeChanged: isTableDisplayModeChanged,
|
|
688
688
|
isNumberColumnChanged: isNumberColumnChanged,
|
|
689
689
|
isNumberOfColumnsChanged: isNumberOfColumnsChanged,
|
|
690
|
-
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged
|
|
690
|
+
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
691
|
+
isTableResized: isTableResized
|
|
691
692
|
});
|
|
692
693
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
693
694
|
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
@@ -788,8 +789,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
788
789
|
shouldScale = true;
|
|
789
790
|
shouldHandleColgroupUpdates = true;
|
|
790
791
|
}
|
|
791
|
-
if (
|
|
792
|
-
|
|
792
|
+
if (!fg('platform_editor_table_width_refactor')) {
|
|
793
|
+
if (this.state.windowResized) {
|
|
794
|
+
shouldHandleColgroupUpdates = true;
|
|
795
|
+
}
|
|
793
796
|
}
|
|
794
797
|
if (shouldHandleColgroupUpdates) {
|
|
795
798
|
this.handleColgroupUpdates();
|
|
@@ -621,7 +621,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
621
621
|
isTableDisplayModeChanged: isTableDisplayModeChanged,
|
|
622
622
|
isNumberColumnChanged: isNumberColumnChanged,
|
|
623
623
|
isNumberOfColumnsChanged: isNumberOfColumnsChanged,
|
|
624
|
-
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged
|
|
624
|
+
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
|
|
625
|
+
isTableResized: isTableResized
|
|
625
626
|
});
|
|
626
627
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
627
628
|
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
@@ -719,8 +720,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
719
720
|
shouldScale = true;
|
|
720
721
|
shouldHandleColgroupUpdates = true;
|
|
721
722
|
}
|
|
722
|
-
if (
|
|
723
|
-
|
|
723
|
+
if (!fg('platform_editor_table_width_refactor')) {
|
|
724
|
+
if (this.state.windowResized) {
|
|
725
|
+
shouldHandleColgroupUpdates = true;
|
|
726
|
+
}
|
|
724
727
|
}
|
|
725
728
|
if (shouldHandleColgroupUpdates) {
|
|
726
729
|
this.handleColgroupUpdates();
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
// #region Imports
|
|
5
5
|
import { AddColumnStep } from '@atlaskit/custom-steps';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
|
|
7
|
+
import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
8
8
|
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -226,16 +226,16 @@ export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEna
|
|
|
226
226
|
/**
|
|
227
227
|
* Unified command to insert a new table into the editor.
|
|
228
228
|
*
|
|
229
|
-
* @param {
|
|
229
|
+
* @param {object} options - Configuration options for table insertion.
|
|
230
230
|
* @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
|
|
231
231
|
* @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
|
|
232
232
|
* @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
|
|
233
233
|
* @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
|
|
234
234
|
* @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
|
|
235
235
|
* @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
|
|
236
|
-
* @param {
|
|
237
|
-
* @param {
|
|
238
|
-
* @param {
|
|
236
|
+
* @param {object} [options.createTableProps={}] - Additional properties for table creation, including table size.
|
|
237
|
+
* @param {object} api - PluginInjectinoApi object for content insertion commands.
|
|
238
|
+
* @param {object} analyticsPayload - Payload for analytics tracking.
|
|
239
239
|
*
|
|
240
240
|
* @returns {Function} A function that takes a transaction and inserts a table.
|
|
241
241
|
*/
|
|
@@ -262,7 +262,7 @@ export var insertTableWithNestingSupport = function insertTableWithNestingSuppor
|
|
|
262
262
|
// If the cursor is inside a table
|
|
263
263
|
var insertAt;
|
|
264
264
|
var isNestedTable = false;
|
|
265
|
-
if (hasParentNodeOfType(schema.nodes.table)(tr.selection) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
265
|
+
if (hasParentNodeOfType(schema.nodes.table)(tr.selection) && isNestedTablesSupported(schema) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
266
266
|
// If the experiment is disabled, or we're trying to nest deeper than one level, we insert the table after the top table
|
|
267
267
|
if (editorExperiment('nested-tables-in-tables', false, {
|
|
268
268
|
exposure: true
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { browser as browserLegacy, getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
6
6
|
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
7
|
+
import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
7
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
9
|
import { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenLayoutNodes, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveOpenNestedExpand } from '@atlaskit/editor-common/transforms';
|
|
9
10
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
@@ -238,7 +239,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
238
239
|
slice = transformSliceToFixDarkModeDefaultBackgroundColor(slice, schema);
|
|
239
240
|
}
|
|
240
241
|
slice = transformSliceToRemoveOpenNestedExpand(slice, schema);
|
|
241
|
-
if (fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
242
|
+
if (isNestedTablesSupported(schema) && fg('platform_editor_use_nested_table_pm_nodes')) {
|
|
242
243
|
slice = transformSliceToRemoveNestedTables(slice, schema, editorState.selection);
|
|
243
244
|
}
|
|
244
245
|
return slice;
|
|
@@ -4,6 +4,7 @@ import { calcTableColumnWidths, getFragmentBackingArray } from '@atlaskit/editor
|
|
|
4
4
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { COLUMN_MIN_WIDTH, MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
|
|
8
9
|
import { getScalingPercentForTableWithoutWidth, getTableContainerElementWidth, getTableScalingPercent } from './misc';
|
|
9
10
|
/**
|
|
@@ -69,17 +70,27 @@ export var generateColgroupFromNode = function generateColgroupFromNode(table, i
|
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
} else {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
if (!isTableScalingEnabled && fg('platform_editor_table_width_refactor')) {
|
|
74
|
+
cols.push.apply(cols, _toConsumableArray(Array.from({
|
|
75
|
+
length: colspan
|
|
76
|
+
}, function (_) {
|
|
77
|
+
return ['col', {
|
|
78
|
+
style: "width: ".concat(tableCellMinWidth, "px;")
|
|
79
|
+
}];
|
|
80
|
+
})));
|
|
81
|
+
} else {
|
|
82
|
+
// columns has not been resized, so distribute the width evenly
|
|
83
|
+
cols.push.apply(cols, _toConsumableArray(Array.from({
|
|
84
|
+
length: colspan
|
|
85
|
+
}, function (_) {
|
|
86
|
+
var tableWidth = getTableContainerElementWidth(table);
|
|
87
|
+
var columnWidth = tableWidth / map.width || 0;
|
|
88
|
+
var fixedColWidth = getColWidthFix(columnWidth, map.width || 0);
|
|
89
|
+
return ['col', {
|
|
90
|
+
style: generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth)
|
|
91
|
+
}];
|
|
92
|
+
})));
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
95
|
});
|
|
85
96
|
return cols;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { createElement } from 'react';
|
|
3
3
|
import { RawIntlProvider } from 'react-intl-next';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
5
|
import uuid from 'uuid/v4';
|
|
5
6
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
6
7
|
|
|
@@ -262,6 +263,7 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
|
|
|
262
263
|
return emptyResult;
|
|
263
264
|
}
|
|
264
265
|
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) {
|
|
266
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
265
267
|
var decorationRenderKey = uuid();
|
|
266
268
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
267
269
|
return Decoration.widget(position, function () {
|
|
@@ -14,6 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
|
|
15
15
|
import { createElement } from 'react';
|
|
16
16
|
import { RawIntlProvider } from 'react-intl-next';
|
|
17
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
17
18
|
import uuid from 'uuid/v4';
|
|
18
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
19
20
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
@@ -106,6 +107,7 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
106
107
|
var map = TableMap.get(tableNode);
|
|
107
108
|
var hasMergedCells = new Set(map.map).size !== map.map.length;
|
|
108
109
|
map.mapByRow[0].forEach(function (cell, index) {
|
|
110
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
109
111
|
var decorationRenderKey = uuid();
|
|
110
112
|
decs.push(Decoration.widget(cell + pos + 2, function () {
|
|
111
113
|
var _sort$tableId;
|
|
@@ -6,6 +6,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
6
6
|
import { ResizerBreakoutModeLabel } from '@atlaskit/editor-common/resizer';
|
|
7
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
9
10
|
import FloatingContextualButton from './FloatingContextualButton';
|
|
10
11
|
import FloatingContextualMenu from './FloatingContextualMenu';
|
|
11
12
|
import FloatingDeleteButton from './FloatingDeleteButton';
|
|
@@ -137,7 +138,8 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
137
138
|
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
138
139
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
139
140
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
140
|
-
api: api
|
|
141
|
+
api: api,
|
|
142
|
+
isDragMenuOpen: isDragAndDropEnabled && expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
141
143
|
}), isDragAndDropEnabled && /*#__PURE__*/React.createElement(FloatingDragMenu, {
|
|
142
144
|
editorView: editorView,
|
|
143
145
|
mountPoint: popupsMountPoint,
|
|
@@ -46,6 +46,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
46
46
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
47
47
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
48
48
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
49
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
49
50
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
50
51
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
51
52
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
@@ -742,6 +743,16 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
742
743
|
}));
|
|
743
744
|
}
|
|
744
745
|
}
|
|
746
|
+
}, {
|
|
747
|
+
key: "componentDidUpdate",
|
|
748
|
+
value: function componentDidUpdate() {
|
|
749
|
+
var _getPluginState11 = getPluginState(this.props.editorView.state),
|
|
750
|
+
isDragAndDropEnabled = _getPluginState11.isDragAndDropEnabled,
|
|
751
|
+
isContextualMenuOpen = _getPluginState11.isContextualMenuOpen;
|
|
752
|
+
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen && expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
753
|
+
toggleContextualMenu()(this.props.editorView.state, this.props.editorView.dispatch);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
745
756
|
}, {
|
|
746
757
|
key: "render",
|
|
747
758
|
value: function render() {
|
|
@@ -754,8 +765,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
754
765
|
editorView = _this$props13.editorView,
|
|
755
766
|
isCellMenuOpenByKeyboard = _this$props13.isCellMenuOpenByKeyboard,
|
|
756
767
|
api = _this$props13.api;
|
|
757
|
-
var
|
|
758
|
-
isDragAndDropEnabled =
|
|
768
|
+
var _getPluginState12 = getPluginState(editorView.state),
|
|
769
|
+
isDragAndDropEnabled = _getPluginState12.isDragAndDropEnabled;
|
|
759
770
|
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
760
771
|
var isOpenAllowed = false;
|
|
761
772
|
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
@@ -796,7 +807,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
796
807
|
};
|
|
797
808
|
if (expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true)) {
|
|
798
809
|
return jsx(UserIntentPopupWrapper, {
|
|
799
|
-
userIntent: "
|
|
810
|
+
userIntent: "tableContextualMenuPopupOpen",
|
|
800
811
|
api: api
|
|
801
812
|
}, popupContent());
|
|
802
813
|
}
|
|
@@ -10,6 +10,7 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
+
import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
13
14
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
14
15
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
15
16
|
|
|
@@ -29,6 +30,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
29
30
|
getEditorFeatureFlags = _ref.getEditorFeatureFlags,
|
|
30
31
|
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
|
|
31
32
|
isCommentEditor = _ref.isCommentEditor,
|
|
33
|
+
isDragMenuOpen = _ref.isDragMenuOpen,
|
|
32
34
|
api = _ref.api;
|
|
33
35
|
if (expValEquals('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
34
36
|
return null;
|
|
@@ -110,7 +112,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
110
112
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
111
113
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
112
114
|
isCommentEditor: isCommentEditor,
|
|
113
|
-
api: api
|
|
115
|
+
api: api,
|
|
116
|
+
isDragMenuOpen: expValNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? isDragMenuOpen : undefined
|
|
114
117
|
})));
|
|
115
118
|
};
|
|
116
119
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -550,7 +550,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
550
550
|
});
|
|
551
551
|
return isToolbarAIFCEnabled || expValEquals('platform_editor_lovability_user_intent', 'isEnabled', true) ? jsx(UserIntentPopupWrapper, {
|
|
552
552
|
api: api,
|
|
553
|
-
userIntent: expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? '
|
|
553
|
+
userIntent: expValEqualsNoExposure('platform_editor_lovability_user_intent', 'isEnabled', true) ? 'tableDragMenuPopupOpen' : undefined
|
|
554
554
|
}, Menu) : Menu;
|
|
555
555
|
});
|
|
556
556
|
export default injectIntl(DragMenu);
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -14,7 +14,7 @@ import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/a
|
|
|
14
14
|
import { DropdownMenuExtensionItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
15
15
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
16
16
|
import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
17
|
-
import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
17
|
+
import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
18
18
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
19
19
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
20
20
|
import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -481,7 +481,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
481
481
|
onBlur: clearHoverSelection()
|
|
482
482
|
}]
|
|
483
483
|
};
|
|
484
|
-
var isNestedTable = fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(state);
|
|
484
|
+
var isNestedTable = isNestedTablesSupported(state.schema) && fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(state);
|
|
485
485
|
var hoverTableProps = function hoverTableProps(isInDanger, isSelected) {
|
|
486
486
|
return {
|
|
487
487
|
onMouseEnter: hoverTable(isInDanger, isSelected),
|
|
@@ -36,16 +36,16 @@ export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isT
|
|
|
36
36
|
/**
|
|
37
37
|
* Unified command to insert a new table into the editor.
|
|
38
38
|
*
|
|
39
|
-
* @param {
|
|
39
|
+
* @param {object} options - Configuration options for table insertion.
|
|
40
40
|
* @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
|
|
41
41
|
* @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
|
|
42
42
|
* @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
|
|
43
43
|
* @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
|
|
44
44
|
* @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
|
|
45
45
|
* @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
46
|
+
* @param {object} [options.createTableProps={}] - Additional properties for table creation, including table size.
|
|
47
|
+
* @param {object} api - PluginInjectinoApi object for content insertion commands.
|
|
48
|
+
* @param {object} analyticsPayload - Payload for analytics tracking.
|
|
49
49
|
*
|
|
50
50
|
* @returns {Function} A function that takes a transaction and inserts a table.
|
|
51
51
|
*/
|
|
@@ -22,6 +22,7 @@ interface Props {
|
|
|
22
22
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
23
23
|
isCellMenuOpenByKeyboard?: boolean;
|
|
24
24
|
isCommentEditor?: boolean;
|
|
25
|
+
isDragMenuOpen?: boolean;
|
|
25
26
|
isOpen: boolean;
|
|
26
27
|
mountPoint?: HTMLElement;
|
|
27
28
|
offset?: Array<number>;
|
|
@@ -39,6 +40,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
39
40
|
};
|
|
40
41
|
private dropdownMenuRef;
|
|
41
42
|
componentDidMount(): void;
|
|
43
|
+
componentDidUpdate(): void;
|
|
42
44
|
render(): jsx.JSX.Element;
|
|
43
45
|
private handleSubMenuRef;
|
|
44
46
|
private createBackgroundColorItem;
|
|
@@ -16,6 +16,7 @@ interface Props {
|
|
|
16
16
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
17
17
|
isCellMenuOpenByKeyboard?: boolean;
|
|
18
18
|
isCommentEditor?: boolean;
|
|
19
|
+
isDragMenuOpen?: boolean;
|
|
19
20
|
isOpen: boolean;
|
|
20
21
|
mountPoint?: HTMLElement;
|
|
21
22
|
pluginConfig?: PluginConfig;
|
|
@@ -23,7 +24,7 @@ interface Props {
|
|
|
23
24
|
targetCellPosition?: number;
|
|
24
25
|
}
|
|
25
26
|
declare const FloatingContextualMenu: {
|
|
26
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, }: Props): jsx.JSX.Element | null;
|
|
27
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, isDragMenuOpen, api, }: Props): jsx.JSX.Element | null;
|
|
27
28
|
displayName: string;
|
|
28
29
|
};
|
|
29
30
|
export default FloatingContextualMenu;
|
|
@@ -36,16 +36,16 @@ export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isT
|
|
|
36
36
|
/**
|
|
37
37
|
* Unified command to insert a new table into the editor.
|
|
38
38
|
*
|
|
39
|
-
* @param {
|
|
39
|
+
* @param {object} options - Configuration options for table insertion.
|
|
40
40
|
* @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
|
|
41
41
|
* @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
|
|
42
42
|
* @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
|
|
43
43
|
* @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
|
|
44
44
|
* @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
|
|
45
45
|
* @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
46
|
+
* @param {object} [options.createTableProps={}] - Additional properties for table creation, including table size.
|
|
47
|
+
* @param {object} api - PluginInjectinoApi object for content insertion commands.
|
|
48
|
+
* @param {object} analyticsPayload - Payload for analytics tracking.
|
|
49
49
|
*
|
|
50
50
|
* @returns {Function} A function that takes a transaction and inserts a table.
|
|
51
51
|
*/
|
|
@@ -22,6 +22,7 @@ interface Props {
|
|
|
22
22
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
23
23
|
isCellMenuOpenByKeyboard?: boolean;
|
|
24
24
|
isCommentEditor?: boolean;
|
|
25
|
+
isDragMenuOpen?: boolean;
|
|
25
26
|
isOpen: boolean;
|
|
26
27
|
mountPoint?: HTMLElement;
|
|
27
28
|
offset?: Array<number>;
|
|
@@ -39,6 +40,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
39
40
|
};
|
|
40
41
|
private dropdownMenuRef;
|
|
41
42
|
componentDidMount(): void;
|
|
43
|
+
componentDidUpdate(): void;
|
|
42
44
|
render(): jsx.JSX.Element;
|
|
43
45
|
private handleSubMenuRef;
|
|
44
46
|
private createBackgroundColorItem;
|
|
@@ -16,6 +16,7 @@ interface Props {
|
|
|
16
16
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
17
17
|
isCellMenuOpenByKeyboard?: boolean;
|
|
18
18
|
isCommentEditor?: boolean;
|
|
19
|
+
isDragMenuOpen?: boolean;
|
|
19
20
|
isOpen: boolean;
|
|
20
21
|
mountPoint?: HTMLElement;
|
|
21
22
|
pluginConfig?: PluginConfig;
|
|
@@ -23,7 +24,7 @@ interface Props {
|
|
|
23
24
|
targetCellPosition?: number;
|
|
24
25
|
}
|
|
25
26
|
declare const FloatingContextualMenu: {
|
|
26
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, }: Props): jsx.JSX.Element | null;
|
|
27
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, isDragMenuOpen, api, }: Props): jsx.JSX.Element | null;
|
|
27
28
|
displayName: string;
|
|
28
29
|
};
|
|
29
30
|
export default FloatingContextualMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "15.3.
|
|
3
|
+
"version": "15.3.12",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/primitives": "^16.1.0",
|
|
60
60
|
"@atlaskit/react-ufo": "^4.14.0",
|
|
61
61
|
"@atlaskit/theme": "^21.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^13.31.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.1.0",
|
|
64
64
|
"@atlaskit/tokens": "^7.1.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.7.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^3.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^110.
|
|
75
|
+
"@atlaskit/editor-common": "^110.24.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"
|
|
@@ -144,6 +144,9 @@
|
|
|
144
144
|
},
|
|
145
145
|
"platform_editor_content_mode_button_mvp": {
|
|
146
146
|
"type": "boolean"
|
|
147
|
+
},
|
|
148
|
+
"platform_editor_table_width_refactor": {
|
|
149
|
+
"type": "boolean"
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|