@atlaskit/editor-plugin-table 7.16.1 → 7.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/commands/insert.js +14 -2
- package/dist/cjs/nodeviews/TableComponent.js +4 -2
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +1 -0
- package/dist/cjs/nodeviews/TableContainer.js +73 -34
- package/dist/cjs/nodeviews/TableResizer.js +4 -1
- package/dist/cjs/nodeviews/table.js +7 -4
- package/dist/cjs/plugin.js +12 -3
- package/dist/cjs/pm-plugins/keymap.js +1 -13
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/es2019/commands/insert.js +15 -3
- package/dist/es2019/nodeviews/TableComponent.js +5 -2
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +1 -0
- package/dist/es2019/nodeviews/TableContainer.js +52 -11
- package/dist/es2019/nodeviews/TableResizer.js +4 -1
- package/dist/es2019/nodeviews/table.js +7 -4
- package/dist/es2019/plugin.js +11 -3
- package/dist/es2019/pm-plugins/keymap.js +4 -14
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/esm/commands/insert.js +15 -3
- package/dist/esm/nodeviews/TableComponent.js +4 -2
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +1 -0
- package/dist/esm/nodeviews/TableContainer.js +74 -35
- package/dist/esm/nodeviews/TableResizer.js +4 -1
- package/dist/esm/nodeviews/table.js +7 -4
- package/dist/esm/plugin.js +12 -3
- package/dist/esm/pm-plugins/keymap.js +4 -16
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/types/commands/insert.d.ts +3 -2
- package/dist/types/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/nodeviews/TableContainer.d.ts +7 -5
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/nodeviews/table.d.ts +1 -1
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/commands/insert.d.ts +3 -2
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -5
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/package.json +5 -5
- package/src/commands/insert.ts +26 -18
- package/src/nodeviews/TableComponent.tsx +3 -0
- package/src/nodeviews/TableComponentWithSharedState.tsx +1 -0
- package/src/nodeviews/TableContainer.tsx +76 -13
- package/src/nodeviews/TableResizer.tsx +11 -1
- package/src/nodeviews/table.tsx +4 -1
- package/src/nodeviews/types.ts +1 -0
- package/src/plugin.tsx +18 -8
- package/src/pm-plugins/keymap.ts +4 -25
- package/src/pm-plugins/main.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.16.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#102385](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102385)
|
|
8
|
+
[`501e08d95a31`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/501e08d95a31) -
|
|
9
|
+
[ux] Resize ratio depends on table alignment option. Fixed resize ratio for the cases when table
|
|
10
|
+
alignment is not 'center'.
|
|
11
|
+
|
|
12
|
+
## 7.16.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#101820](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101820)
|
|
17
|
+
[`d6a194ef42d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d6a194ef42d7) -
|
|
18
|
+
Add new left alignment to table container in editor, based on layout node attribute
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 7.16.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -143,11 +143,23 @@ var insertRow = exports.insertRow = function insertRow(row, moveCursorToTheNewRo
|
|
|
143
143
|
return true;
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
|
-
var createTable = exports.createTable = function createTable(isTableScalingEnabled, isFullWidthModeEnabled) {
|
|
146
|
+
var createTable = exports.createTable = function createTable(isTableScalingEnabled, isFullWidthModeEnabled, editorAnalyticsAPI) {
|
|
147
147
|
return function (state, dispatch) {
|
|
148
148
|
var table = (0, _utils3.createTableWithWidth)(isTableScalingEnabled, isFullWidthModeEnabled)(state.schema);
|
|
149
149
|
if (dispatch) {
|
|
150
|
-
|
|
150
|
+
var tr = (0, _utils.safeInsert)(table)(state.tr).scrollIntoView();
|
|
151
|
+
if (editorAnalyticsAPI) {
|
|
152
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
153
|
+
action: _analytics.ACTION.INSERTED,
|
|
154
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
155
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
156
|
+
attributes: {
|
|
157
|
+
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
158
|
+
},
|
|
159
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
160
|
+
})(tr);
|
|
161
|
+
}
|
|
162
|
+
dispatch(tr);
|
|
151
163
|
}
|
|
152
164
|
return true;
|
|
153
165
|
};
|
|
@@ -652,7 +652,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
652
652
|
pluginInjectionApi = _this$props11.pluginInjectionApi,
|
|
653
653
|
isDragAndDropEnabled = _this$props11.isDragAndDropEnabled,
|
|
654
654
|
getEditorFeatureFlags = _this$props11.getEditorFeatureFlags,
|
|
655
|
-
isTableScalingEnabled = _this$props11.isTableScalingEnabled
|
|
655
|
+
isTableScalingEnabled = _this$props11.isTableScalingEnabled,
|
|
656
|
+
isTableAlignmentEnabled = _this$props11.isTableAlignmentEnabled;
|
|
656
657
|
var _this$props12 = this.props,
|
|
657
658
|
isInDanger = _this$props12.isInDanger,
|
|
658
659
|
hoveredRows = _this$props12.hoveredRows,
|
|
@@ -761,7 +762,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
761
762
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled,
|
|
762
763
|
isResizing: isResizing,
|
|
763
764
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
764
|
-
isWholeTableInDanger: isWholeTableInDanger
|
|
765
|
+
isWholeTableInDanger: isWholeTableInDanger,
|
|
766
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
765
767
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
766
768
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
767
769
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -69,6 +69,7 @@ var TableComponentWithSharedState = exports.TableComponentWithSharedState = func
|
|
|
69
69
|
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
70
70
|
isDragAndDropEnabled: options === null || options === void 0 ? void 0 : options.isDragAndDropEnabled,
|
|
71
71
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
72
|
+
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
72
73
|
tableActive: tableActive,
|
|
73
74
|
ordering: ordering,
|
|
74
75
|
isResizing: isResizing,
|
|
@@ -31,19 +31,57 @@ var InnerContainer = exports.InnerContainer = /*#__PURE__*/(0, _react.forwardRef
|
|
|
31
31
|
"data-testid": "table-container"
|
|
32
32
|
}, children);
|
|
33
33
|
});
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
var centerAlignStyle = {
|
|
35
|
+
display: 'flex',
|
|
36
|
+
justifyContent: 'center'
|
|
37
|
+
};
|
|
38
|
+
var leftAlignStyle = {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
justifyContent: 'flex-start'
|
|
41
|
+
};
|
|
42
|
+
var AlignmentTableContainer = function AlignmentTableContainer(_ref2) {
|
|
43
|
+
var node = _ref2.node,
|
|
44
|
+
children = _ref2.children;
|
|
45
|
+
var alignment = node.attrs.layout;
|
|
46
|
+
var style = (0, _react.useMemo)(function () {
|
|
47
|
+
return alignment === 'align-start' ? leftAlignStyle : centerAlignStyle;
|
|
48
|
+
}, [alignment]);
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
50
|
+
"data-testid": "table-alignment-container",
|
|
51
|
+
style: style
|
|
52
|
+
}, children);
|
|
53
|
+
};
|
|
54
|
+
var AlignmentTableContainerWrapper = function AlignmentTableContainerWrapper(_ref3) {
|
|
55
|
+
var isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
56
|
+
node = _ref3.node,
|
|
57
|
+
children = _ref3.children;
|
|
58
|
+
if (!isTableAlignmentEnabled) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
"data-testid": "table-alignment-container",
|
|
61
|
+
style: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
justifyContent: 'center'
|
|
64
|
+
}
|
|
65
|
+
}, children);
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(AlignmentTableContainer, {
|
|
68
|
+
node: node
|
|
69
|
+
}, children);
|
|
70
|
+
};
|
|
71
|
+
var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_react.default.memo(function (_ref4) {
|
|
72
|
+
var children = _ref4.children,
|
|
73
|
+
className = _ref4.className,
|
|
74
|
+
node = _ref4.node,
|
|
75
|
+
containerWidth = _ref4.containerWidth,
|
|
76
|
+
editorView = _ref4.editorView,
|
|
77
|
+
getPos = _ref4.getPos,
|
|
78
|
+
tableRef = _ref4.tableRef,
|
|
79
|
+
isResizing = _ref4.isResizing,
|
|
80
|
+
pluginInjectionApi = _ref4.pluginInjectionApi,
|
|
81
|
+
tableWrapperHeight = _ref4.tableWrapperHeight,
|
|
82
|
+
isWholeTableInDanger = _ref4.isWholeTableInDanger,
|
|
83
|
+
isTableScalingEnabled = _ref4.isTableScalingEnabled,
|
|
84
|
+
isTableAlignmentEnabled = _ref4.isTableAlignmentEnabled;
|
|
47
85
|
var containerRef = (0, _react.useRef)(null);
|
|
48
86
|
var tableWidthRef = (0, _react.useRef)(_editorSharedStyles.akEditorDefaultLayoutWidth);
|
|
49
87
|
var _useState = (0, _react.useState)(false),
|
|
@@ -125,6 +163,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
125
163
|
displayGuideline: displayGuideline,
|
|
126
164
|
attachAnalyticsEvent: attachAnalyticsEvent,
|
|
127
165
|
displayGapCursor: displayGapCursor,
|
|
166
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
128
167
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
129
168
|
isWholeTableInDanger: isWholeTableInDanger,
|
|
130
169
|
pluginInjectionApi: pluginInjectionApi,
|
|
@@ -132,11 +171,9 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
132
171
|
onResizeStop: onResizeStop
|
|
133
172
|
};
|
|
134
173
|
var isLivePageViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
135
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
justifyContent: 'center'
|
|
139
|
-
}
|
|
174
|
+
return /*#__PURE__*/_react.default.createElement(AlignmentTableContainerWrapper, {
|
|
175
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
176
|
+
node: node
|
|
140
177
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
141
178
|
style: {
|
|
142
179
|
width: tableWidthRef.current,
|
|
@@ -156,21 +193,22 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
156
193
|
node: node
|
|
157
194
|
}, children))));
|
|
158
195
|
});
|
|
159
|
-
var TableContainer = exports.TableContainer = function TableContainer(
|
|
160
|
-
var children =
|
|
161
|
-
node =
|
|
162
|
-
className =
|
|
163
|
-
editorWidth =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
196
|
+
var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
|
|
197
|
+
var children = _ref5.children,
|
|
198
|
+
node = _ref5.node,
|
|
199
|
+
className = _ref5.className,
|
|
200
|
+
editorWidth = _ref5.containerWidth.width,
|
|
201
|
+
editorView = _ref5.editorView,
|
|
202
|
+
getPos = _ref5.getPos,
|
|
203
|
+
tableRef = _ref5.tableRef,
|
|
204
|
+
isNested = _ref5.isNested,
|
|
205
|
+
tableWrapperHeight = _ref5.tableWrapperHeight,
|
|
206
|
+
isResizing = _ref5.isResizing,
|
|
207
|
+
pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
208
|
+
isWholeTableInDanger = _ref5.isWholeTableInDanger,
|
|
209
|
+
isTableResizingEnabled = _ref5.isTableResizingEnabled,
|
|
210
|
+
isTableScalingEnabled = _ref5.isTableScalingEnabled,
|
|
211
|
+
isTableAlignmentEnabled = _ref5.isTableAlignmentEnabled;
|
|
174
212
|
if (isTableResizingEnabled && !isNested) {
|
|
175
213
|
return /*#__PURE__*/_react.default.createElement(ResizableTableContainer, {
|
|
176
214
|
className: className,
|
|
@@ -183,7 +221,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref3) {
|
|
|
183
221
|
isResizing: isResizing,
|
|
184
222
|
pluginInjectionApi: pluginInjectionApi,
|
|
185
223
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
186
|
-
isWholeTableInDanger: isWholeTableInDanger
|
|
224
|
+
isWholeTableInDanger: isWholeTableInDanger,
|
|
225
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
187
226
|
}, children);
|
|
188
227
|
}
|
|
189
228
|
return /*#__PURE__*/_react.default.createElement(InnerContainer, {
|
|
@@ -25,6 +25,7 @@ var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
|
25
25
|
var _utils3 = require("../pm-plugins/table-resizing/utils");
|
|
26
26
|
var _tableWidth = require("../pm-plugins/table-width");
|
|
27
27
|
var _consts = require("../ui/consts");
|
|
28
|
+
var _alignment = require("../utils/alignment");
|
|
28
29
|
var _analytics2 = require("../utils/analytics");
|
|
29
30
|
var _guidelines = require("../utils/guidelines");
|
|
30
31
|
var _snapping = require("../utils/snapping");
|
|
@@ -98,6 +99,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
98
99
|
attachAnalyticsEvent = _ref.attachAnalyticsEvent,
|
|
99
100
|
displayGapCursor = _ref.displayGapCursor,
|
|
100
101
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
102
|
+
isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
|
|
101
103
|
isWholeTableInDanger = _ref.isWholeTableInDanger,
|
|
102
104
|
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
103
105
|
var currentGap = (0, _react.useRef)(0);
|
|
@@ -365,6 +367,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
365
367
|
(_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 || _updateTooltip$curren.call(updateTooltip);
|
|
366
368
|
}
|
|
367
369
|
}, [width]);
|
|
370
|
+
var resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && (0, _alignment.normaliseAlignment)(node.attrs.layout) === 'center' ? 2 : 1;
|
|
368
371
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_resizer.ResizerNext, {
|
|
369
372
|
ref: resizerRef,
|
|
370
373
|
enable: handles,
|
|
@@ -375,7 +378,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
375
378
|
handleResizeStart: handleResizeStart,
|
|
376
379
|
handleResize: scheduleResize,
|
|
377
380
|
handleResizeStop: handleResizeStop,
|
|
378
|
-
resizeRatio:
|
|
381
|
+
resizeRatio: resizeRatio,
|
|
379
382
|
minWidth: resizerMinWidth,
|
|
380
383
|
maxWidth: maxWidth,
|
|
381
384
|
snapGap: _consts.TABLE_SNAP_GAP,
|
|
@@ -176,7 +176,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
176
176
|
},
|
|
177
177
|
editorView: props.view,
|
|
178
178
|
render: function render(pluginStates) {
|
|
179
|
-
var _props$options;
|
|
179
|
+
var _props$options, _props$options2;
|
|
180
180
|
var tableResizingPluginState = pluginStates.tableResizingPluginState,
|
|
181
181
|
tableWidthPluginState = pluginStates.tableWidthPluginState,
|
|
182
182
|
pluginState = pluginStates.pluginState,
|
|
@@ -208,8 +208,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
208
208
|
isHeaderRowEnabled: pluginState.isHeaderRowEnabled,
|
|
209
209
|
isHeaderColumnEnabled: pluginState.isHeaderColumnEnabled,
|
|
210
210
|
isDragAndDropEnabled: pluginState.isDragAndDropEnabled,
|
|
211
|
-
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled
|
|
211
|
+
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled same as TableOptions.isTableScalingEnabled same as pluginState.isTableScalingEnabled
|
|
212
212
|
,
|
|
213
|
+
isTableAlignmentEnabled: (_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.isTableAlignmentEnabled,
|
|
213
214
|
tableActive: tableActive,
|
|
214
215
|
ordering: pluginState.ordering,
|
|
215
216
|
isResizing: isResizing,
|
|
@@ -283,7 +284,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
283
284
|
}]);
|
|
284
285
|
return TableView;
|
|
285
286
|
}(_reactNodeView.default);
|
|
286
|
-
var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi) {
|
|
287
|
+
var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled) {
|
|
287
288
|
var _getPluginState2 = (0, _pluginFactory.getPluginState)(view.state),
|
|
288
289
|
pluginConfig = _getPluginState2.pluginConfig,
|
|
289
290
|
isFullWidthModeEnabled = _getPluginState2.isFullWidthModeEnabled,
|
|
@@ -308,7 +309,9 @@ var createTableView = exports.createTableView = function createTableView(node, v
|
|
|
308
309
|
wasFullWidthModeEnabled: wasFullWidthModeEnabled,
|
|
309
310
|
isTableResizingEnabled: isTableResizingEnabled,
|
|
310
311
|
isDragAndDropEnabled: isDragAndDropEnabled,
|
|
311
|
-
isTableScalingEnabled: isTableScalingEnabled
|
|
312
|
+
isTableScalingEnabled: isTableScalingEnabled,
|
|
313
|
+
// same as options.isTableScalingEnabled
|
|
314
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
312
315
|
},
|
|
313
316
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
314
317
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -45,6 +46,8 @@ var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertB
|
|
|
45
46
|
var _FloatingToolbarLabel = require("./ui/FloatingToolbarLabel/FloatingToolbarLabel");
|
|
46
47
|
var _TableFullWidthLabel = require("./ui/TableFullWidthLabel");
|
|
47
48
|
var _utils2 = require("./utils");
|
|
49
|
+
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; }
|
|
50
|
+
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; }
|
|
48
51
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
49
52
|
return {};
|
|
50
53
|
};
|
|
@@ -110,7 +113,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
110
113
|
node: node,
|
|
111
114
|
options: {
|
|
112
115
|
selectNodeInserted: false,
|
|
113
|
-
analyticsPayload: analyticsPayload
|
|
116
|
+
analyticsPayload: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
117
|
+
attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
|
|
118
|
+
localId: node.attrs.localId
|
|
119
|
+
})
|
|
120
|
+
})
|
|
114
121
|
}
|
|
115
122
|
})) !== null && _api$contentInsertion !== void 0 ? _api$contentInsertion : false;
|
|
116
123
|
};
|
|
@@ -435,13 +442,15 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
435
442
|
var _api$table;
|
|
436
443
|
// see comment on tablesPlugin.getSharedState on usage
|
|
437
444
|
var tableState = api === null || api === void 0 || (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
|
|
438
|
-
var
|
|
445
|
+
var tableNode = (0, _utils2.createTableWithWidth)(options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled)(state.schema);
|
|
446
|
+
var tr = insert(tableNode);
|
|
439
447
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
440
448
|
action: _analytics.ACTION.INSERTED,
|
|
441
449
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
442
450
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
443
451
|
attributes: {
|
|
444
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
452
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT,
|
|
453
|
+
localId: tableNode.attrs.localId
|
|
445
454
|
},
|
|
446
455
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
447
456
|
})(tr);
|
|
@@ -15,18 +15,6 @@ var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
|
15
15
|
var _columnResize = require("../commands/column-resize");
|
|
16
16
|
var _insert = require("../commands/insert");
|
|
17
17
|
var _commandsWithAnalytics2 = require("../pm-plugins/drag-and-drop/commands-with-analytics");
|
|
18
|
-
var _analytics2 = require("../utils/analytics");
|
|
19
|
-
var createTableWithAnalytics = function createTableWithAnalytics(isTableScalingEnabled, isFullWidthModeEnabled, editorAnalyticsAPI) {
|
|
20
|
-
return (0, _analytics2.withEditorAnalyticsAPI)({
|
|
21
|
-
action: _analytics.ACTION.INSERTED,
|
|
22
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
23
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
24
|
-
attributes: {
|
|
25
|
-
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
26
|
-
},
|
|
27
|
-
eventType: _analytics.EVENT_TYPE.TRACK
|
|
28
|
-
})(editorAnalyticsAPI)((0, _commands2.createTable)(isTableScalingEnabled, isFullWidthModeEnabled));
|
|
29
|
-
};
|
|
30
18
|
function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
31
19
|
var _pluginInjectionApi$a;
|
|
32
20
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
@@ -37,7 +25,7 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
37
25
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
38
26
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
39
27
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.previousCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
40
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleTable.common,
|
|
28
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleTable.common, (0, _insert.createTable)(isTableScalingEnabled, !!isFullWidthEnabled, editorAnalyticsAPI), list);
|
|
41
29
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)), list);
|
|
42
30
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, _commands2.moveCursorBackward, list);
|
|
43
31
|
|
|
@@ -260,7 +260,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
260
260
|
},
|
|
261
261
|
nodeViews: {
|
|
262
262
|
table: function table(node, view, getPos) {
|
|
263
|
-
return (0, _table.createTableView)(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi);
|
|
263
|
+
return (0, _table.createTableView)(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled);
|
|
264
264
|
},
|
|
265
265
|
tableRow: function tableRow(node, view, getPos) {
|
|
266
266
|
return new _TableRow.default(node, view, getPos, eventDispatcher);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { AddColumnStep } from '@atlaskit/custom-steps';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -119,10 +119,22 @@ export const insertRow = (row, moveCursorToTheNewRow, isCellBackgroundDuplicated
|
|
|
119
119
|
}
|
|
120
120
|
return true;
|
|
121
121
|
};
|
|
122
|
-
export const createTable = (isTableScalingEnabled, isFullWidthModeEnabled) => (state, dispatch) => {
|
|
122
|
+
export const createTable = (isTableScalingEnabled, isFullWidthModeEnabled, editorAnalyticsAPI) => (state, dispatch) => {
|
|
123
123
|
const table = createTableWithWidth(isTableScalingEnabled, isFullWidthModeEnabled)(state.schema);
|
|
124
124
|
if (dispatch) {
|
|
125
|
-
|
|
125
|
+
const tr = safeInsert(table)(state.tr).scrollIntoView();
|
|
126
|
+
if (editorAnalyticsAPI) {
|
|
127
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
128
|
+
action: ACTION.INSERTED,
|
|
129
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
130
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
131
|
+
attributes: {
|
|
132
|
+
inputMethod: INPUT_METHOD.SHORTCUT
|
|
133
|
+
},
|
|
134
|
+
eventType: EVENT_TYPE.TRACK
|
|
135
|
+
})(tr);
|
|
136
|
+
}
|
|
137
|
+
dispatch(tr);
|
|
126
138
|
}
|
|
127
139
|
return true;
|
|
128
140
|
};
|
|
@@ -636,7 +636,9 @@ class TableComponent extends React.Component {
|
|
|
636
636
|
pluginInjectionApi,
|
|
637
637
|
isDragAndDropEnabled,
|
|
638
638
|
getEditorFeatureFlags,
|
|
639
|
-
isTableScalingEnabled
|
|
639
|
+
isTableScalingEnabled,
|
|
640
|
+
// here we can use options.isTableScalingEnabled
|
|
641
|
+
isTableAlignmentEnabled
|
|
640
642
|
} = this.props;
|
|
641
643
|
let {
|
|
642
644
|
isInDanger,
|
|
@@ -752,7 +754,8 @@ class TableComponent extends React.Component {
|
|
|
752
754
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled,
|
|
753
755
|
isResizing: isResizing,
|
|
754
756
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
755
|
-
isWholeTableInDanger: isWholeTableInDanger
|
|
757
|
+
isWholeTableInDanger: isWholeTableInDanger,
|
|
758
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
756
759
|
}, /*#__PURE__*/React.createElement("div", {
|
|
757
760
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
758
761
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -65,6 +65,7 @@ export const TableComponentWithSharedState = ({
|
|
|
65
65
|
isHeaderColumnEnabled: isHeaderColumnEnabled,
|
|
66
66
|
isDragAndDropEnabled: options === null || options === void 0 ? void 0 : options.isDragAndDropEnabled,
|
|
67
67
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
68
|
+
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
68
69
|
tableActive: tableActive,
|
|
69
70
|
ordering: ordering,
|
|
70
71
|
isResizing: isResizing,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useCallback, useRef, useState } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
@@ -21,6 +21,45 @@ export const InnerContainer = /*#__PURE__*/forwardRef(({
|
|
|
21
21
|
"data-testid": "table-container"
|
|
22
22
|
}, children);
|
|
23
23
|
});
|
|
24
|
+
const centerAlignStyle = {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center'
|
|
27
|
+
};
|
|
28
|
+
const leftAlignStyle = {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
justifyContent: 'flex-start'
|
|
31
|
+
};
|
|
32
|
+
const AlignmentTableContainer = ({
|
|
33
|
+
node,
|
|
34
|
+
children
|
|
35
|
+
}) => {
|
|
36
|
+
const alignment = node.attrs.layout;
|
|
37
|
+
const style = useMemo(() => {
|
|
38
|
+
return alignment === 'align-start' ? leftAlignStyle : centerAlignStyle;
|
|
39
|
+
}, [alignment]);
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
"data-testid": "table-alignment-container",
|
|
42
|
+
style: style
|
|
43
|
+
}, children);
|
|
44
|
+
};
|
|
45
|
+
const AlignmentTableContainerWrapper = ({
|
|
46
|
+
isTableAlignmentEnabled,
|
|
47
|
+
node,
|
|
48
|
+
children
|
|
49
|
+
}) => {
|
|
50
|
+
if (!isTableAlignmentEnabled) {
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
"data-testid": "table-alignment-container",
|
|
53
|
+
style: {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
justifyContent: 'center'
|
|
56
|
+
}
|
|
57
|
+
}, children);
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/React.createElement(AlignmentTableContainer, {
|
|
60
|
+
node: node
|
|
61
|
+
}, children);
|
|
62
|
+
};
|
|
24
63
|
export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
25
64
|
children,
|
|
26
65
|
className,
|
|
@@ -31,9 +70,10 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
31
70
|
tableRef,
|
|
32
71
|
isResizing,
|
|
33
72
|
pluginInjectionApi,
|
|
34
|
-
isTableScalingEnabled,
|
|
35
73
|
tableWrapperHeight,
|
|
36
|
-
isWholeTableInDanger
|
|
74
|
+
isWholeTableInDanger,
|
|
75
|
+
isTableScalingEnabled,
|
|
76
|
+
isTableAlignmentEnabled
|
|
37
77
|
}) => {
|
|
38
78
|
const containerRef = useRef(null);
|
|
39
79
|
const tableWidthRef = useRef(akEditorDefaultLayoutWidth);
|
|
@@ -114,6 +154,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
114
154
|
displayGuideline,
|
|
115
155
|
attachAnalyticsEvent,
|
|
116
156
|
displayGapCursor,
|
|
157
|
+
isTableAlignmentEnabled,
|
|
117
158
|
isTableScalingEnabled,
|
|
118
159
|
isWholeTableInDanger,
|
|
119
160
|
pluginInjectionApi,
|
|
@@ -121,11 +162,9 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
121
162
|
onResizeStop
|
|
122
163
|
};
|
|
123
164
|
const isLivePageViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
124
|
-
return /*#__PURE__*/React.createElement(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
justifyContent: 'center'
|
|
128
|
-
}
|
|
165
|
+
return /*#__PURE__*/React.createElement(AlignmentTableContainerWrapper, {
|
|
166
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
167
|
+
node: node
|
|
129
168
|
}, /*#__PURE__*/React.createElement("div", {
|
|
130
169
|
style: {
|
|
131
170
|
width: tableWidthRef.current,
|
|
@@ -152,7 +191,6 @@ export const TableContainer = ({
|
|
|
152
191
|
containerWidth: {
|
|
153
192
|
width: editorWidth
|
|
154
193
|
},
|
|
155
|
-
isTableResizingEnabled,
|
|
156
194
|
editorView,
|
|
157
195
|
getPos,
|
|
158
196
|
tableRef,
|
|
@@ -160,8 +198,10 @@ export const TableContainer = ({
|
|
|
160
198
|
tableWrapperHeight,
|
|
161
199
|
isResizing,
|
|
162
200
|
pluginInjectionApi,
|
|
201
|
+
isWholeTableInDanger,
|
|
202
|
+
isTableResizingEnabled,
|
|
163
203
|
isTableScalingEnabled,
|
|
164
|
-
|
|
204
|
+
isTableAlignmentEnabled
|
|
165
205
|
}) => {
|
|
166
206
|
if (isTableResizingEnabled && !isNested) {
|
|
167
207
|
return /*#__PURE__*/React.createElement(ResizableTableContainer, {
|
|
@@ -175,7 +215,8 @@ export const TableContainer = ({
|
|
|
175
215
|
isResizing: isResizing,
|
|
176
216
|
pluginInjectionApi: pluginInjectionApi,
|
|
177
217
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
178
|
-
isWholeTableInDanger: isWholeTableInDanger
|
|
218
|
+
isWholeTableInDanger: isWholeTableInDanger,
|
|
219
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
179
220
|
}, children);
|
|
180
221
|
}
|
|
181
222
|
return /*#__PURE__*/React.createElement(InnerContainer, {
|
|
@@ -15,6 +15,7 @@ import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
|
15
15
|
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable, TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils';
|
|
16
16
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
17
17
|
import { TABLE_GUIDELINE_VISIBLE_ADJUSTMENT, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE, TABLE_SNAP_GAP } from '../ui/consts';
|
|
18
|
+
import { normaliseAlignment } from '../utils/alignment';
|
|
18
19
|
import { generateResizedPayload, generateResizeFrameRatePayloads, useMeasureFramerate } from '../utils/analytics';
|
|
19
20
|
import { defaultGuidelines, defaultGuidelinesForPreserveTable } from '../utils/guidelines';
|
|
20
21
|
import { defaultSnappingWidths, defaultTablePreserveSnappingWidths, findClosestSnap } from '../utils/snapping';
|
|
@@ -83,6 +84,7 @@ export const TableResizer = ({
|
|
|
83
84
|
attachAnalyticsEvent,
|
|
84
85
|
displayGapCursor,
|
|
85
86
|
isTableScalingEnabled,
|
|
87
|
+
isTableAlignmentEnabled,
|
|
86
88
|
isWholeTableInDanger,
|
|
87
89
|
pluginInjectionApi
|
|
88
90
|
}) => {
|
|
@@ -363,6 +365,7 @@ export const TableResizer = ({
|
|
|
363
365
|
(_updateTooltip$curren = updateTooltip.current) === null || _updateTooltip$curren === void 0 ? void 0 : _updateTooltip$curren.call(updateTooltip);
|
|
364
366
|
}
|
|
365
367
|
}, [width]);
|
|
368
|
+
const resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && normaliseAlignment(node.attrs.layout) === 'center' ? 2 : 1;
|
|
366
369
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
|
|
367
370
|
ref: resizerRef,
|
|
368
371
|
enable: handles,
|
|
@@ -373,7 +376,7 @@ export const TableResizer = ({
|
|
|
373
376
|
handleResizeStart: handleResizeStart,
|
|
374
377
|
handleResize: scheduleResize,
|
|
375
378
|
handleResizeStop: handleResizeStop,
|
|
376
|
-
resizeRatio:
|
|
379
|
+
resizeRatio: resizeRatio,
|
|
377
380
|
minWidth: resizerMinWidth,
|
|
378
381
|
maxWidth: maxWidth,
|
|
379
382
|
snapGap: TABLE_SNAP_GAP,
|
|
@@ -144,7 +144,7 @@ export default class TableView extends ReactNodeView {
|
|
|
144
144
|
},
|
|
145
145
|
editorView: props.view,
|
|
146
146
|
render: pluginStates => {
|
|
147
|
-
var _props$options;
|
|
147
|
+
var _props$options, _props$options2;
|
|
148
148
|
const {
|
|
149
149
|
tableResizingPluginState,
|
|
150
150
|
tableWidthPluginState,
|
|
@@ -178,8 +178,9 @@ export default class TableView extends ReactNodeView {
|
|
|
178
178
|
isHeaderRowEnabled: pluginState.isHeaderRowEnabled,
|
|
179
179
|
isHeaderColumnEnabled: pluginState.isHeaderColumnEnabled,
|
|
180
180
|
isDragAndDropEnabled: pluginState.isDragAndDropEnabled,
|
|
181
|
-
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled
|
|
181
|
+
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled same as TableOptions.isTableScalingEnabled same as pluginState.isTableScalingEnabled
|
|
182
182
|
,
|
|
183
|
+
isTableAlignmentEnabled: (_props$options2 = props.options) === null || _props$options2 === void 0 ? void 0 : _props$options2.isTableAlignmentEnabled,
|
|
183
184
|
tableActive: tableActive,
|
|
184
185
|
ordering: pluginState.ordering,
|
|
185
186
|
isResizing: isResizing,
|
|
@@ -249,7 +250,7 @@ export default class TableView extends ReactNodeView {
|
|
|
249
250
|
super.destroy();
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
|
-
export const createTableView = (node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi) => {
|
|
253
|
+
export const createTableView = (node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled) => {
|
|
253
254
|
const {
|
|
254
255
|
pluginConfig,
|
|
255
256
|
isFullWidthModeEnabled,
|
|
@@ -276,7 +277,9 @@ export const createTableView = (node, view, getPos, portalProviderAPI, eventDisp
|
|
|
276
277
|
wasFullWidthModeEnabled,
|
|
277
278
|
isTableResizingEnabled,
|
|
278
279
|
isDragAndDropEnabled,
|
|
279
|
-
isTableScalingEnabled
|
|
280
|
+
isTableScalingEnabled,
|
|
281
|
+
// same as options.isTableScalingEnabled
|
|
282
|
+
isTableAlignmentEnabled
|
|
280
283
|
},
|
|
281
284
|
getEditorContainerWidth,
|
|
282
285
|
getEditorFeatureFlags,
|