@atlaskit/editor-plugin-table 21.0.0 → 22.1.0
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 +52 -0
- package/dist/cjs/nodeviews/TableComponent.js +20 -4
- package/dist/cjs/nodeviews/table.js +15 -13
- package/dist/cjs/nodeviews/toDOM.js +8 -5
- package/dist/cjs/pm-plugins/keymap.js +12 -12
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/pm-plugins/table-width.js +8 -5
- package/dist/cjs/pm-plugins/utils/tableMode.js +15 -34
- package/dist/cjs/tablePlugin.js +40 -45
- package/dist/cjs/ui/ContentComponent.js +0 -1
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/cjs/ui/toolbar.js +5 -11
- package/dist/es2019/nodeviews/TableComponent.js +18 -2
- package/dist/es2019/nodeviews/table.js +14 -14
- package/dist/es2019/nodeviews/toDOM.js +8 -5
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +3 -3
- package/dist/es2019/pm-plugins/table-width.js +8 -5
- package/dist/es2019/pm-plugins/utils/tableMode.js +6 -24
- package/dist/es2019/tablePlugin.js +4 -10
- package/dist/es2019/ui/ContentComponent.js +0 -1
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/es2019/ui/toolbar.js +4 -10
- package/dist/esm/nodeviews/TableComponent.js +18 -2
- package/dist/esm/nodeviews/table.js +16 -14
- package/dist/esm/nodeviews/toDOM.js +8 -5
- package/dist/esm/pm-plugins/keymap.js +12 -12
- package/dist/esm/pm-plugins/main.js +3 -3
- package/dist/esm/pm-plugins/table-width.js +8 -5
- package/dist/esm/pm-plugins/utils/tableMode.js +14 -33
- package/dist/esm/tablePlugin.js +40 -45
- package/dist/esm/ui/ContentComponent.js +0 -1
- package/dist/esm/ui/global-styles.js +1 -2
- package/dist/esm/ui/toolbar.js +5 -11
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/utils/tableMode.d.ts +3 -6
- package/dist/types/tablePluginType.d.ts +0 -6
- package/dist/types/ui/global-styles.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/tableMode.d.ts +3 -6
- package/dist/types-ts4.5/tablePluginType.d.ts +0 -6
- package/dist/types-ts4.5/ui/global-styles.d.ts +1 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 22.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3394e81c10e6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3394e81c10e6e) -
|
|
8
|
+
Fix table flicker on focus: defer data-initial-width-mode removal to after colgroup update.
|
|
9
|
+
Consolidate isTableInContentMode and hasTableBeenResized into editor-common/table.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 22.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [`b47ee185c5ac4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b47ee185c5ac4) -
|
|
20
|
+
Remove deprecated dragAndDropEnabled plugin option Drag and drop table rows/ columns and advanced
|
|
21
|
+
table controls used to be toggled with dragAndDropEnabled table plugin option however we're
|
|
22
|
+
deprecating this prop to make this the default behaviour.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
// Before - to turn on drag and drop:
|
|
26
|
+
|
|
27
|
+
const createPreset = () =>
|
|
28
|
+
createDefaultPreset({ featureFlags: {}, paste: {} })
|
|
29
|
+
.add([tablePlugin, {tableOptions: {}, dragAndDropEnabled: true}])
|
|
30
|
+
|
|
31
|
+
const { preset } = usePreset(createPreset);
|
|
32
|
+
|
|
33
|
+
// Now - drag and drop enabled even without prop
|
|
34
|
+
const createPreset = () =>
|
|
35
|
+
createDefaultPreset({ featureFlags: {}, paste: {} })
|
|
36
|
+
.add([tablePlugin, {tableOptions: {}}])
|
|
37
|
+
|
|
38
|
+
const { preset } = usePreset(createPreset);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The `dragAndDropEnabled` property has also been removed from the `TablePluginOptions` TypeScript
|
|
42
|
+
interface.
|
|
43
|
+
|
|
44
|
+
**Note:** If you previously set `dragAndDropEnabled: false` to explicitly disable drag and drop,
|
|
45
|
+
this is no longer supported — drag and drop is now always enabled and cannot be turned off via
|
|
46
|
+
this option.
|
|
47
|
+
|
|
48
|
+
If issues occur when bumping editor package, please check if dragAndDropEnabled is still present
|
|
49
|
+
in editor integration.
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies
|
|
54
|
+
|
|
3
55
|
## 21.0.0
|
|
4
56
|
|
|
5
57
|
### Major Changes
|
|
@@ -21,6 +21,7 @@ var _collab = require("@atlaskit/editor-common/collab");
|
|
|
21
21
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
22
22
|
var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
|
|
23
23
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
24
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
24
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
25
26
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
26
27
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
@@ -38,7 +39,8 @@ var _misc = require("../pm-plugins/table-resizing/utils/misc");
|
|
|
38
39
|
var _resizeState = require("../pm-plugins/table-resizing/utils/resize-state");
|
|
39
40
|
var _scaleTable = require("../pm-plugins/table-resizing/utils/scale-table");
|
|
40
41
|
var _nodes = require("../pm-plugins/utils/nodes");
|
|
41
|
-
var
|
|
42
|
+
var _table2 = require("../pm-plugins/utils/table");
|
|
43
|
+
var _tableMode = require("../pm-plugins/utils/tableMode");
|
|
42
44
|
var _types = require("../types");
|
|
43
45
|
var _eventHandlers = require("../ui/event-handlers");
|
|
44
46
|
var _TableFloatingColumnControls = _interopRequireDefault(require("../ui/TableFloatingColumnControls"));
|
|
@@ -720,7 +722,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
720
722
|
var isNoOfRowsChanged = (0, _nodes.tablesHaveDifferentNoOfRows)(currentTable, previousTable);
|
|
721
723
|
if (isNoOfColumnsChanged || isNoOfRowsChanged) {
|
|
722
724
|
var _this$props$pluginInj;
|
|
723
|
-
(_this$props$pluginInj = this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || (_this$props$pluginInj = _this$props$pluginInj.accessibilityUtils) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.actions.ariaNotify((0,
|
|
725
|
+
(_this$props$pluginInj = this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || (_this$props$pluginInj = _this$props$pluginInj.accessibilityUtils) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.actions.ariaNotify((0, _table2.getAssistiveMessage)(previousTable, currentTable, this.props.intl), {
|
|
724
726
|
priority: 'important'
|
|
725
727
|
});
|
|
726
728
|
}
|
|
@@ -737,10 +739,24 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
737
739
|
var view = this.props.view;
|
|
738
740
|
var shouldRecreateResizeCols = !allowTableResizing || !isResizing || isNoOfColumnsChanged && isResizing;
|
|
739
741
|
if (shouldRecreateResizeCols) {
|
|
742
|
+
var _this$table7, _this$props$options10, _this$props$options11;
|
|
740
743
|
var start = getPos() || 0;
|
|
741
744
|
var depth = view.state.doc.resolve(start).depth;
|
|
742
745
|
shouldScale = depth === 0 && shouldScale;
|
|
743
746
|
(0, _colgroup.insertColgroupFromNode)(this.table, currentTable, shouldScale, undefined, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.isCommentEditor);
|
|
747
|
+
|
|
748
|
+
// Deferred from setDomAttrs — remove only once colgroup is updated and table has left content mode.
|
|
749
|
+
if ((_this$table7 = this.table) !== null && _this$table7 !== void 0 && _this$table7.hasAttribute('data-initial-width-mode') && !(0, _table.isTableInContentMode)({
|
|
750
|
+
tableNode: currentTable,
|
|
751
|
+
isSupported: (0, _tableMode.isContentModeSupported)({
|
|
752
|
+
allowColumnResizing: !!allowColumnResizing,
|
|
753
|
+
allowTableResizing: !!allowTableResizing,
|
|
754
|
+
isFullPageEditor: !((_this$props$options10 = this.props.options) !== null && _this$props$options10 !== void 0 && _this$props$options10.isCommentEditor) && !((_this$props$options11 = this.props.options) !== null && _this$props$options11 !== void 0 && _this$props$options11.isChromelessEditor)
|
|
755
|
+
}),
|
|
756
|
+
isTableNested: (0, _nodes.isTableNested)(view.state, getPos())
|
|
757
|
+
})) {
|
|
758
|
+
this.table.removeAttribute('data-initial-width-mode');
|
|
759
|
+
}
|
|
744
760
|
}
|
|
745
761
|
(0, _dom.updateControls)()(view.state);
|
|
746
762
|
}
|
|
@@ -768,7 +784,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
768
784
|
key: "render",
|
|
769
785
|
value: function render() {
|
|
770
786
|
var _this5 = this,
|
|
771
|
-
_this$props$
|
|
787
|
+
_this$props$options12;
|
|
772
788
|
var _this$props10 = this.props,
|
|
773
789
|
view = _this$props10.view,
|
|
774
790
|
getNode = _this$props10.getNode,
|
|
@@ -872,7 +888,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
872
888
|
var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
|
|
873
889
|
_getEditorFeatureFlag4 = _getEditorFeatureFlag3.tableWithFixedColumnWidthsOption,
|
|
874
890
|
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag4 === void 0 ? false : _getEditorFeatureFlag4;
|
|
875
|
-
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$
|
|
891
|
+
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$options12 = this.props.options) !== null && _this$props$options12 !== void 0 && _this$props$options12.isCommentEditor));
|
|
876
892
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
|
|
877
893
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
878
894
|
, {
|
|
@@ -16,13 +16,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
18
18
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
19
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
19
20
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
20
21
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
23
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
23
24
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
25
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
25
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
26
26
|
var _createPluginConfig = require("../pm-plugins/create-plugin-config");
|
|
27
27
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
28
28
|
var _tableWidth = require("../pm-plugins/table-width");
|
|
@@ -206,7 +206,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
206
206
|
}, {
|
|
207
207
|
key: "setDomAttrs",
|
|
208
208
|
value: function setDomAttrs(node) {
|
|
209
|
-
var
|
|
209
|
+
var _this$reactComponentP6,
|
|
210
|
+
_this$reactComponentP7,
|
|
211
|
+
_this3 = this,
|
|
210
212
|
_this$reactComponentP8,
|
|
211
213
|
_this$getEditorFeatur2,
|
|
212
214
|
_this$options3,
|
|
@@ -215,19 +217,19 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
215
217
|
return; // width / attribute application to actual table will happen later when table is set
|
|
216
218
|
}
|
|
217
219
|
var attrs = tableAttributes(node);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
|
|
221
|
+
// render table with content-mode attribute which removes all width constraints from the table
|
|
222
|
+
// fire exposure here
|
|
223
|
+
if ((0, _table.isTableInContentMode)({
|
|
224
|
+
tableNode: node,
|
|
225
|
+
isSupported: (0, _tableMode.isContentModeSupported)({
|
|
222
226
|
allowColumnResizing: !!this.reactComponentProps.allowColumnResizing,
|
|
223
227
|
allowTableResizing: !!this.reactComponentProps.allowTableResizing,
|
|
224
|
-
isFullPageEditor: !((_this$reactComponentP6 = this.reactComponentProps.options) !== null && _this$reactComponentP6 !== void 0 && _this$reactComponentP6.isCommentEditor) && !((_this$reactComponentP7 = this.reactComponentProps.options) !== null && _this$reactComponentP7 !== void 0 && _this$reactComponentP7.isChromelessEditor)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this.table.removeAttribute('data-initial-width-mode');
|
|
230
|
-
}
|
|
228
|
+
isFullPageEditor: !((_this$reactComponentP6 = this.reactComponentProps.options) !== null && _this$reactComponentP6 !== void 0 && _this$reactComponentP6.isCommentEditor) && !((_this$reactComponentP7 = this.reactComponentProps.options) !== null && _this$reactComponentP7 !== void 0 && _this$reactComponentP7.isChromelessEditor)
|
|
229
|
+
}),
|
|
230
|
+
isTableNested: (0, _nodes.isTableNested)(this.view.state, this.getPos())
|
|
231
|
+
}) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
232
|
+
attrs['data-initial-width-mode'] = 'content';
|
|
231
233
|
}
|
|
232
234
|
Object.keys(attrs).forEach(function (attr) {
|
|
233
235
|
// Ignored via go/ees005
|
|
@@ -12,6 +12,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
12
12
|
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
13
13
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
14
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
15
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
15
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
17
|
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
17
18
|
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
@@ -25,11 +26,13 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
|
|
|
25
26
|
return _objectSpread(_objectSpread({}, tableNode), {}, {
|
|
26
27
|
toDOM: function toDOM(node) {
|
|
27
28
|
var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
|
|
28
|
-
var isInContentMode = (0,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var isInContentMode = (0, _table.isTableInContentMode)({
|
|
30
|
+
tableNode: node,
|
|
31
|
+
isSupported: (0, _tableMode.isContentModeSupported)({
|
|
32
|
+
allowColumnResizing: config.allowColumnResizing,
|
|
33
|
+
allowTableResizing: config.tableResizingEnabled,
|
|
34
|
+
isFullPageEditor: isFullPageEditor
|
|
35
|
+
}),
|
|
33
36
|
isTableNested: config.isNested
|
|
34
37
|
}) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
|
|
35
38
|
var alignmentStyle = Object.entries((0, _tableContainerStyles.getAlignmentStyle)(node.attrs.layout)).map(function (_ref) {
|
|
@@ -17,18 +17,18 @@ var _columnResize = require("./commands/column-resize");
|
|
|
17
17
|
var _commandsWithAnalytics2 = require("./commands/commands-with-analytics");
|
|
18
18
|
var _goToNextCell = require("./commands/go-to-next-cell");
|
|
19
19
|
var _insert = require("./commands/insert");
|
|
20
|
-
function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI
|
|
20
|
+
function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI) {
|
|
21
21
|
var _pluginInjectionApi$a;
|
|
22
|
-
var isTableScalingEnabled = arguments.length >
|
|
23
|
-
var isTableAlignmentEnabled = arguments.length >
|
|
24
|
-
var isFullWidthEnabled = arguments.length >
|
|
25
|
-
var pluginInjectionApi = arguments.length >
|
|
26
|
-
var getIntl = arguments.length >
|
|
27
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length >
|
|
28
|
-
var shouldUseIncreasedScalingPercent = arguments.length >
|
|
29
|
-
var isCommentEditor = arguments.length >
|
|
30
|
-
var isChromelessEditor = arguments.length >
|
|
31
|
-
var isTableResizingEnabled = arguments.length >
|
|
22
|
+
var isTableScalingEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
23
|
+
var isTableAlignmentEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
24
|
+
var isFullWidthEnabled = arguments.length > 6 ? arguments[6] : undefined;
|
|
25
|
+
var pluginInjectionApi = arguments.length > 7 ? arguments[7] : undefined;
|
|
26
|
+
var getIntl = arguments.length > 8 ? arguments[8] : undefined;
|
|
27
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
28
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 10 ? arguments[10] : undefined;
|
|
29
|
+
var isCommentEditor = arguments.length > 11 ? arguments[11] : undefined;
|
|
30
|
+
var isChromelessEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
31
|
+
var isTableResizingEnabled = arguments.length > 13 ? arguments[13] : undefined;
|
|
32
32
|
var list = {};
|
|
33
33
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
34
34
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
@@ -99,7 +99,7 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
99
99
|
// Ignored via go/ees005
|
|
100
100
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
101
101
|
_keymaps.addColumnAfterVO.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
102
|
-
if (
|
|
102
|
+
if (_keymaps.moveRowDown.common && _keymaps.moveRowUp.common && _keymaps.moveColumnLeft.common && _keymaps.moveColumnRight.common) {
|
|
103
103
|
var isNewKeyMapExperiment = (0, _expValEquals.expValEquals)('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true);
|
|
104
104
|
// Move row/column shortcuts
|
|
105
105
|
/**
|
|
@@ -36,7 +36,7 @@ var _paste = require("./utils/paste");
|
|
|
36
36
|
var _tableMode = require("./utils/tableMode");
|
|
37
37
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
38
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled,
|
|
39
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
|
|
40
40
|
var _accessibilityUtils;
|
|
41
41
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
42
42
|
pluginConfig: pluginConfig,
|
|
@@ -49,7 +49,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
49
49
|
wasFullWidthModeEnabled: previousFullWidthModeEnabled,
|
|
50
50
|
isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
|
|
51
51
|
isHeaderColumnEnabled: false,
|
|
52
|
-
isDragAndDropEnabled:
|
|
52
|
+
isDragAndDropEnabled: true,
|
|
53
53
|
isTableScalingEnabled: isTableScalingEnabled
|
|
54
54
|
}, _defaultTableSelection.defaultHoveredCell), _defaultTableSelection.defaultTableSelection), {}, {
|
|
55
55
|
getIntl: getIntl
|
|
@@ -82,7 +82,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
82
82
|
tableRow: (0, _tableNodeViews.tableRowView)({
|
|
83
83
|
eventDispatcher: eventDispatcher,
|
|
84
84
|
pluginInjectionApi: pluginInjectionApi,
|
|
85
|
-
isDragAndDropEnabled:
|
|
85
|
+
isDragAndDropEnabled: true
|
|
86
86
|
}),
|
|
87
87
|
tableCell: (0, _tableNodeViews.tableCellView)({
|
|
88
88
|
eventDispatcher: eventDispatcher,
|
|
@@ -9,6 +9,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
11
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
12
13
|
var _document = require("@atlaskit/editor-common/utils/document");
|
|
13
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -69,11 +70,13 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
69
70
|
var tr = newState.tr;
|
|
70
71
|
if (isReplaceDocumentOperation && !isCommentEditor) {
|
|
71
72
|
newState.doc.forEach(function (node, offset) {
|
|
72
|
-
if ((0,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
if ((0, _table.isTableInContentMode)({
|
|
74
|
+
tableNode: node,
|
|
75
|
+
isSupported: (0, _tableMode.isContentModeSupported)({
|
|
76
|
+
allowColumnResizing: true,
|
|
77
|
+
allowTableResizing: true,
|
|
78
|
+
isFullPageEditor: true
|
|
79
|
+
}),
|
|
77
80
|
isTableNested: false
|
|
78
81
|
})) {
|
|
79
82
|
return;
|
|
@@ -3,41 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.isContentModeSupported = exports.applyMeasuredWidthToSelectedTable = exports.applyMeasuredWidthToAllTables = void 0;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
8
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
9
|
+
var _table = require("@atlaskit/editor-common/table");
|
|
9
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
10
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
11
|
-
var _colgroup = require("../table-resizing/utils/colgroup");
|
|
12
11
|
var _contentMode = require("../transforms/content-mode");
|
|
13
|
-
var
|
|
14
|
-
var isTableInContentMode = exports.isTableInContentMode = function isTableInContentMode(_ref) {
|
|
12
|
+
var isContentModeSupported = exports.isContentModeSupported = function isContentModeSupported(_ref) {
|
|
15
13
|
var allowColumnResizing = _ref.allowColumnResizing,
|
|
16
14
|
allowTableResizing = _ref.allowTableResizing,
|
|
17
|
-
isFullPageEditor = _ref.isFullPageEditor
|
|
18
|
-
isTableNested = _ref.isTableNested,
|
|
19
|
-
node = _ref.node;
|
|
20
|
-
if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (!node || isTableNested) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return isContentModeSupported({
|
|
27
|
-
allowColumnResizing: allowColumnResizing,
|
|
28
|
-
allowTableResizing: allowTableResizing,
|
|
29
|
-
isFullPageEditor: isFullPageEditor
|
|
30
|
-
}) && !hasTableBeenResized(node) && node.attrs.layout === _alignment.ALIGN_START;
|
|
31
|
-
};
|
|
32
|
-
var isContentModeSupported = exports.isContentModeSupported = function isContentModeSupported(_ref2) {
|
|
33
|
-
var allowColumnResizing = _ref2.allowColumnResizing,
|
|
34
|
-
allowTableResizing = _ref2.allowTableResizing,
|
|
35
|
-
isFullPageEditor = _ref2.isFullPageEditor;
|
|
15
|
+
isFullPageEditor = _ref.isFullPageEditor;
|
|
36
16
|
return allowColumnResizing && allowTableResizing && isFullPageEditor;
|
|
37
17
|
};
|
|
38
|
-
var hasTableBeenResized = exports.hasTableBeenResized = function hasTableBeenResized(node) {
|
|
39
|
-
return node.attrs.width !== null || (0, _colgroup.hasTableColumnBeenResized)(node);
|
|
40
|
-
};
|
|
41
18
|
|
|
42
19
|
/**
|
|
43
20
|
* Iterates all top-level tables in the document, and for those in content mode,
|
|
@@ -55,7 +32,7 @@ var applyMeasuredWidthToAllTables = exports.applyMeasuredWidthToAllTables = func
|
|
|
55
32
|
|
|
56
33
|
// modify only top-level tables
|
|
57
34
|
doc.forEach(function (node, offset) {
|
|
58
|
-
if (node.type !== table || hasTableBeenResized(node) && node.attrs.layout !==
|
|
35
|
+
if (node.type !== table || (0, _table.hasTableBeenResized)(node) && node.attrs.layout !== 'align-start') {
|
|
59
36
|
return;
|
|
60
37
|
}
|
|
61
38
|
var domNode = view.domAtPos(offset + 1).node;
|
|
@@ -70,10 +47,10 @@ var applyMeasuredWidthToAllTables = exports.applyMeasuredWidthToAllTables = func
|
|
|
70
47
|
measurement: (0, _contentMode.getTableMeasurement)(tableRef)
|
|
71
48
|
});
|
|
72
49
|
});
|
|
73
|
-
measuredTables.forEach(function (
|
|
74
|
-
var node =
|
|
75
|
-
offset =
|
|
76
|
-
measurement =
|
|
50
|
+
measuredTables.forEach(function (_ref2) {
|
|
51
|
+
var node = _ref2.node,
|
|
52
|
+
offset = _ref2.offset,
|
|
53
|
+
measurement = _ref2.measurement;
|
|
77
54
|
tr = (0, _contentMode.applyTableMeasurement)(tr, node, measurement, offset);
|
|
78
55
|
modified = true;
|
|
79
56
|
});
|
|
@@ -87,8 +64,8 @@ var applyMeasuredWidthToAllTables = exports.applyMeasuredWidthToAllTables = func
|
|
|
87
64
|
attributes: {
|
|
88
65
|
editorContainerWidth: (_pluginInjectionApi$w = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$w2 = pluginInjectionApi.width) === null || _pluginInjectionApi$w2 === void 0 || (_pluginInjectionApi$w2 = _pluginInjectionApi$w2.sharedState.currentState()) === null || _pluginInjectionApi$w2 === void 0 ? void 0 : _pluginInjectionApi$w2.width) !== null && _pluginInjectionApi$w !== void 0 ? _pluginInjectionApi$w : 0,
|
|
89
66
|
totalTablesResized: measuredTables.length,
|
|
90
|
-
measurements: measuredTables.map(function (
|
|
91
|
-
var measurement =
|
|
67
|
+
measurements: measuredTables.map(function (_ref3) {
|
|
68
|
+
var measurement = _ref3.measurement;
|
|
92
69
|
return {
|
|
93
70
|
tableWidth: measurement.tableWidth,
|
|
94
71
|
totalColumnCount: measurement.colWidths.length
|
|
@@ -99,6 +76,10 @@ var applyMeasuredWidthToAllTables = exports.applyMeasuredWidthToAllTables = func
|
|
|
99
76
|
view.dispatch(tr.setMeta('addToHistory', false));
|
|
100
77
|
}
|
|
101
78
|
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
82
|
+
*/
|
|
102
83
|
var applyMeasuredWidthToSelectedTable = exports.applyMeasuredWidthToSelectedTable = function applyMeasuredWidthToSelectedTable(view, api) {
|
|
103
84
|
var _api$analytics, _api$width$sharedStat, _api$width;
|
|
104
85
|
var tableObject = (0, _utils.findTable)(view.state.selection);
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -75,7 +75,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
75
75
|
};
|
|
76
76
|
var options = _objectSpread(_objectSpread({}, config), {}, {
|
|
77
77
|
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
78
|
-
dragAndDropEnabled: (config === null || config === void 0 ? void 0 : config.dragAndDropEnabled) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd'),
|
|
79
78
|
isTableScalingEnabled: (config === null || config === void 0 ? void 0 : config.isTableScalingEnabled) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_scaling')
|
|
80
79
|
});
|
|
81
80
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
@@ -292,11 +291,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
292
291
|
wasFullWidthEnabled = _ref3.wasFullWidthEnabled,
|
|
293
292
|
tableOptions = _ref3.tableOptions,
|
|
294
293
|
getEditorFeatureFlags = _ref3.getEditorFeatureFlags,
|
|
295
|
-
dragAndDropEnabled = _ref3.dragAndDropEnabled,
|
|
296
294
|
isTableScalingEnabled = _ref3.isTableScalingEnabled,
|
|
297
295
|
isCommentEditor = _ref3.isCommentEditor,
|
|
298
296
|
isChromelessEditor = _ref3.isChromelessEditor;
|
|
299
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled,
|
|
297
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
|
|
300
298
|
}
|
|
301
299
|
}, {
|
|
302
300
|
name: 'tablePMColResizing',
|
|
@@ -328,7 +326,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
328
326
|
var getIntl = _ref6.getIntl,
|
|
329
327
|
nodeViewPortalProviderAPI = _ref6.nodeViewPortalProviderAPI;
|
|
330
328
|
var _ref7 = options || {},
|
|
331
|
-
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
332
329
|
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
333
330
|
isTableScalingEnabled = _ref7$isTableScalingE === void 0 ? false : _ref7$isTableScalingE,
|
|
334
331
|
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
@@ -338,7 +335,7 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
338
335
|
_ref7$isChromelessEdi = _ref7.isChromelessEditor,
|
|
339
336
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
340
337
|
tableOptions = _ref7.tableOptions;
|
|
341
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI,
|
|
338
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.allowTableAlignment, fullWidthEnabled, api, getIntl, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.allowTableResizing);
|
|
342
339
|
}
|
|
343
340
|
}, {
|
|
344
341
|
name: 'tableSelectionKeymap',
|
|
@@ -349,12 +346,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
349
346
|
}, {
|
|
350
347
|
name: 'tableEditing',
|
|
351
348
|
plugin: function plugin() {
|
|
352
|
-
var _ref9 = options || {},
|
|
353
|
-
dragAndDropEnabled = _ref9.dragAndDropEnabled;
|
|
354
349
|
return (0, _pmPlugins.tableEditing)({
|
|
355
|
-
reportFixedTable: function reportFixedTable(
|
|
356
|
-
var tr =
|
|
357
|
-
reason =
|
|
350
|
+
reportFixedTable: function reportFixedTable(_ref9) {
|
|
351
|
+
var tr = _ref9.tr,
|
|
352
|
+
reason = _ref9.reason;
|
|
358
353
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
359
354
|
action: _analytics.TABLE_ACTION.FIXED,
|
|
360
355
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
@@ -365,71 +360,71 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
365
360
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
366
361
|
})(tr);
|
|
367
362
|
},
|
|
368
|
-
dragAndDropEnabled:
|
|
363
|
+
dragAndDropEnabled: true
|
|
369
364
|
});
|
|
370
365
|
}
|
|
371
366
|
}, {
|
|
372
367
|
name: 'tableStickyHeaders',
|
|
373
|
-
plugin: function plugin(
|
|
374
|
-
var dispatch =
|
|
368
|
+
plugin: function plugin(_ref0) {
|
|
369
|
+
var dispatch = _ref0.dispatch;
|
|
375
370
|
return options && options.tableOptions.stickyHeaders ? (0, _plugin4.createPlugin)(dispatch, function () {
|
|
376
371
|
return [];
|
|
377
372
|
}) : undefined;
|
|
378
373
|
}
|
|
379
374
|
}, {
|
|
380
375
|
name: 'tableDragAndDrop',
|
|
381
|
-
plugin: function plugin(
|
|
382
|
-
var dispatch =
|
|
383
|
-
return
|
|
376
|
+
plugin: function plugin(_ref1) {
|
|
377
|
+
var dispatch = _ref1.dispatch;
|
|
378
|
+
return (0, _plugin3.createPlugin)(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options.isCommentEditor, api);
|
|
384
379
|
}
|
|
385
380
|
}, {
|
|
386
381
|
name: 'tableViewModeSort',
|
|
387
|
-
plugin: function plugin(
|
|
388
|
-
var nodeViewPortalProviderAPI =
|
|
382
|
+
plugin: function plugin(_ref10) {
|
|
383
|
+
var nodeViewPortalProviderAPI = _ref10.nodeViewPortalProviderAPI;
|
|
389
384
|
return api !== null && api !== void 0 && api.editorViewMode ? (0, _viewModeSort.createPlugin)(api, nodeViewPortalProviderAPI) : undefined;
|
|
390
385
|
}
|
|
391
386
|
}, {
|
|
392
387
|
name: 'tableLocalId',
|
|
393
|
-
plugin: function plugin(
|
|
394
|
-
var dispatch =
|
|
388
|
+
plugin: function plugin(_ref11) {
|
|
389
|
+
var dispatch = _ref11.dispatch;
|
|
395
390
|
return !(0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? (0, _tableLocalId.createPlugin)(dispatch) : undefined;
|
|
396
391
|
}
|
|
397
392
|
}, {
|
|
398
393
|
name: 'tableWidth',
|
|
399
|
-
plugin: function plugin(
|
|
394
|
+
plugin: function plugin(_ref12) {
|
|
400
395
|
var _options$fullWidthEna, _options$maxWidthEnab, _options$isTableScali, _options$tableOptions3, _options$isCommentEdi;
|
|
401
|
-
var dispatchAnalyticsEvent =
|
|
402
|
-
dispatch =
|
|
396
|
+
var dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent,
|
|
397
|
+
dispatch = _ref12.dispatch;
|
|
403
398
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing ? (0, _tableWidth.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$maxWidthEnab = options.maxWidthEnabled) !== null && _options$maxWidthEnab !== void 0 ? _options$maxWidthEnab : false, (_options$isTableScali = options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$tableOptions3 = options.tableOptions.allowTableResizing) !== null && _options$tableOptions3 !== void 0 ? _options$tableOptions3 : false, (_options$isCommentEdi = options.isCommentEditor) !== null && _options$isCommentEdi !== void 0 ? _options$isCommentEdi : false) : undefined;
|
|
404
399
|
}
|
|
405
400
|
}, {
|
|
406
401
|
name: 'tableWidthInCommentFix',
|
|
407
|
-
plugin: function plugin(
|
|
402
|
+
plugin: function plugin(_ref13) {
|
|
408
403
|
var _options$tableOptions4;
|
|
409
|
-
var dispatch =
|
|
404
|
+
var dispatch = _ref13.dispatch;
|
|
410
405
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing && options !== null && options !== void 0 && options.isCommentEditor ? (0, _tableWidthInCommentFix.createPlugin)(dispatch, (_options$tableOptions4 = options.tableOptions.allowTableAlignment) !== null && _options$tableOptions4 !== void 0 ? _options$tableOptions4 : false) : undefined;
|
|
411
406
|
}
|
|
412
407
|
},
|
|
413
408
|
// TODO: ED-26961 - should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
414
409
|
{
|
|
415
410
|
name: 'tableOverflowAnalyticsPlugin',
|
|
416
|
-
plugin: function plugin(
|
|
411
|
+
plugin: function plugin(_ref14) {
|
|
417
412
|
var _options$tableOptions5;
|
|
418
|
-
var dispatch =
|
|
419
|
-
dispatchAnalyticsEvent =
|
|
413
|
+
var dispatch = _ref14.dispatch,
|
|
414
|
+
dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent;
|
|
420
415
|
return (0, _tableAnalytics.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$tableOptions5 = options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) !== null && _options$tableOptions5 !== void 0 ? _options$tableOptions5 : false);
|
|
421
416
|
}
|
|
422
417
|
}, {
|
|
423
418
|
name: 'tableAnalyticsPlugin',
|
|
424
|
-
plugin: function plugin(
|
|
425
|
-
var dispatch =
|
|
426
|
-
dispatchAnalyticsEvent =
|
|
419
|
+
plugin: function plugin(_ref15) {
|
|
420
|
+
var dispatch = _ref15.dispatch,
|
|
421
|
+
dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
|
|
427
422
|
return (0, _plugin.createPlugin)(dispatch, dispatchAnalyticsEvent);
|
|
428
423
|
}
|
|
429
424
|
}, {
|
|
430
425
|
name: 'tableGetEditorViewReferencePlugin',
|
|
431
|
-
plugin: function plugin(
|
|
432
|
-
var dispatchAnalyticsEvent =
|
|
426
|
+
plugin: function plugin(_ref16) {
|
|
427
|
+
var dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
|
|
433
428
|
return new _safePlugin.SafePlugin({
|
|
434
429
|
view: function view(editorView) {
|
|
435
430
|
editorViewRef.current = editorView;
|
|
@@ -483,8 +478,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
483
478
|
}
|
|
484
479
|
}, {
|
|
485
480
|
name: 'tableSizeSelectorPlugin',
|
|
486
|
-
plugin: function plugin(
|
|
487
|
-
var dispatch =
|
|
481
|
+
plugin: function plugin(_ref17) {
|
|
482
|
+
var dispatch = _ref17.dispatch;
|
|
488
483
|
return isTableSelectorEnabled ? (0, _tableSizeSelector.createPlugin)(dispatch) : undefined;
|
|
489
484
|
}
|
|
490
485
|
}, {
|
|
@@ -515,12 +510,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
515
510
|
}
|
|
516
511
|
return plugins;
|
|
517
512
|
},
|
|
518
|
-
contentComponent: function contentComponent(
|
|
519
|
-
var editorView =
|
|
520
|
-
popupsMountPoint =
|
|
521
|
-
popupsBoundariesElement =
|
|
522
|
-
popupsScrollableElement =
|
|
523
|
-
dispatchAnalyticsEvent =
|
|
513
|
+
contentComponent: function contentComponent(_ref18) {
|
|
514
|
+
var editorView = _ref18.editorView,
|
|
515
|
+
popupsMountPoint = _ref18.popupsMountPoint,
|
|
516
|
+
popupsBoundariesElement = _ref18.popupsBoundariesElement,
|
|
517
|
+
popupsScrollableElement = _ref18.popupsScrollableElement,
|
|
518
|
+
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
524
519
|
return /*#__PURE__*/_react.default.createElement(_ContentComponent.ContentComponent, {
|
|
525
520
|
api: api,
|
|
526
521
|
editorView: editorView,
|
|
@@ -535,8 +530,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
535
530
|
});
|
|
536
531
|
},
|
|
537
532
|
pluginsOptions: {
|
|
538
|
-
quickInsert: function quickInsert(
|
|
539
|
-
var formatMessage =
|
|
533
|
+
quickInsert: function quickInsert(_ref19) {
|
|
534
|
+
var formatMessage = _ref19.formatMessage;
|
|
540
535
|
return [{
|
|
541
536
|
id: 'table',
|
|
542
537
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -606,8 +601,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
606
601
|
return editorViewRef.current;
|
|
607
602
|
}, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
608
603
|
},
|
|
609
|
-
usePluginHook: function usePluginHook(
|
|
610
|
-
var editorView =
|
|
604
|
+
usePluginHook: function usePluginHook(_ref20) {
|
|
605
|
+
var editorView = _ref20.editorView;
|
|
611
606
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
612
607
|
var _states$editorViewMod;
|
|
613
608
|
return {
|
|
@@ -219,7 +219,6 @@ var ContentComponent = exports.ContentComponent = function ContentComponent(_ref
|
|
|
219
219
|
fallbackComponent: null
|
|
220
220
|
}, /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, {
|
|
221
221
|
featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState(),
|
|
222
|
-
isDragAndDropEnabledOption: options === null || options === void 0 ? void 0 : options.dragAndDropEnabled,
|
|
223
222
|
api: api
|
|
224
223
|
}), /*#__PURE__*/_react.default.createElement(ContentComponentInternal, {
|
|
225
224
|
api: api,
|
|
@@ -15,7 +15,6 @@ var _commonStyles = require("./common-styles");
|
|
|
15
15
|
|
|
16
16
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
17
17
|
var featureFlags = _ref.featureFlags,
|
|
18
|
-
isDragAndDropEnabledOption = _ref.isDragAndDropEnabledOption,
|
|
19
18
|
api = _ref.api;
|
|
20
19
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
21
20
|
var _states$editorViewMod;
|
|
@@ -28,7 +27,7 @@ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWra
|
|
|
28
27
|
return (0, _react.jsx)(_react.Global, {
|
|
29
28
|
styles: (0, _commonStyles.tableStyles)({
|
|
30
29
|
featureFlags: featureFlags,
|
|
31
|
-
isDragAndDropEnabled:
|
|
30
|
+
isDragAndDropEnabled: !isLivePageViewMode
|
|
32
31
|
})
|
|
33
32
|
});
|
|
34
33
|
};
|