@atlaskit/editor-plugin-table 4.0.2 → 4.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 +12 -0
- package/dist/cjs/i18n/cs.js +2 -3
- package/dist/cjs/i18n/da.js +2 -3
- package/dist/cjs/i18n/de.js +2 -3
- package/dist/cjs/i18n/en.js +2 -3
- package/dist/cjs/i18n/en_GB.js +2 -3
- package/dist/cjs/i18n/en_ZZ.js +2 -3
- package/dist/cjs/i18n/es.js +2 -3
- package/dist/cjs/i18n/fi.js +2 -3
- package/dist/cjs/i18n/fr.js +2 -3
- package/dist/cjs/i18n/hu.js +2 -3
- package/dist/cjs/i18n/it.js +2 -3
- package/dist/cjs/i18n/ja.js +2 -3
- package/dist/cjs/i18n/ko.js +2 -3
- package/dist/cjs/i18n/nb.js +2 -3
- package/dist/cjs/i18n/nl.js +2 -3
- package/dist/cjs/i18n/pl.js +2 -3
- package/dist/cjs/i18n/pt_BR.js +2 -3
- package/dist/cjs/i18n/ru.js +2 -3
- package/dist/cjs/i18n/sv.js +2 -3
- package/dist/cjs/i18n/th.js +2 -3
- package/dist/cjs/i18n/tr.js +2 -3
- package/dist/cjs/i18n/uk.js +2 -3
- package/dist/cjs/i18n/vi.js +2 -3
- package/dist/cjs/i18n/zh.js +2 -3
- package/dist/cjs/i18n/zh_TW.js +2 -3
- package/dist/cjs/plugins/table/commands/clear.js +3 -5
- package/dist/cjs/plugins/table/commands/collapse.js +2 -3
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -3
- package/dist/cjs/plugins/table/commands/hover.js +8 -15
- package/dist/cjs/plugins/table/commands/insert.js +6 -11
- package/dist/cjs/plugins/table/commands/misc.js +23 -45
- package/dist/cjs/plugins/table/commands/referentiality.js +2 -3
- package/dist/cjs/plugins/table/commands/selection.js +3 -6
- package/dist/cjs/plugins/table/commands/sort.js +2 -3
- package/dist/cjs/plugins/table/commands/split-cell.js +2 -3
- package/dist/cjs/plugins/table/commands/toggle.js +7 -13
- package/dist/cjs/plugins/table/commands-with-analytics.js +19 -37
- package/dist/cjs/plugins/table/create-plugin-config.js +2 -3
- package/dist/cjs/plugins/table/event-handlers.js +12 -22
- package/dist/cjs/plugins/table/handlers.js +2 -3
- package/dist/cjs/plugins/table/index.js +8 -9
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +5 -6
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -3
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -13
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +4 -5
- package/dist/cjs/plugins/table/nodeviews/TableStickyScrollbar.js +5 -10
- package/dist/cjs/plugins/table/nodeviews/table.js +4 -6
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +2 -3
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +5 -9
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/default-table-selection.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +3 -6
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +6 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-analytics.js +5 -8
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +7 -13
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +3 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +3 -6
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +7 -13
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +5 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/consts.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +8 -15
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +70 -71
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +11 -21
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +5 -9
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -5
- package/dist/cjs/plugins/table/reducer.js +2 -3
- package/dist/cjs/plugins/table/toolbar.js +5 -9
- package/dist/cjs/plugins/table/transforms/column-width.js +4 -6
- package/dist/cjs/plugins/table/transforms/delete-columns.js +58 -58
- package/dist/cjs/plugins/table/transforms/delete-rows.js +52 -52
- package/dist/cjs/plugins/table/transforms/fix-tables.js +3 -6
- package/dist/cjs/plugins/table/transforms/replace-table.js +3 -4
- package/dist/cjs/plugins/table/types.js +5 -9
- package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +2 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +5 -10
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +3 -5
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -7
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +2 -4
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +2 -4
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +2 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +23 -14
- package/dist/cjs/plugins/table/ui/consts.js +47 -94
- package/dist/cjs/plugins/table/ui/messages.js +2 -3
- package/dist/cjs/plugins/table/ui/ui-styles.js +32 -38
- package/dist/cjs/plugins/table/utils/analytics.js +7 -12
- package/dist/cjs/plugins/table/utils/collapse.js +3 -5
- package/dist/cjs/plugins/table/utils/column-controls.js +6 -11
- package/dist/cjs/plugins/table/utils/decoration.js +10 -19
- package/dist/cjs/plugins/table/utils/dom.js +16 -28
- package/dist/cjs/plugins/table/utils/guidelines.js +1 -2
- package/dist/cjs/plugins/table/utils/nodes.js +12 -23
- package/dist/cjs/plugins/table/utils/paste.js +10 -16
- package/dist/cjs/plugins/table/utils/row-controls.js +7 -13
- package/dist/cjs/plugins/table/utils/selection.js +5 -9
- package/dist/cjs/plugins/table/utils/snapping.js +4 -7
- package/dist/cjs/plugins/table/utils/table.js +3 -5
- package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +2 -3
- package/dist/cjs/plugins/table-plugin.js +1 -2
- package/dist/es2019/plugins/table/ui/common-styles.js +40 -4
- package/dist/es2019/plugins/table/ui/ui-styles.js +223 -85
- package/dist/esm/plugins/table/event-handlers.js +1 -1
- package/dist/esm/plugins/table/index.js +7 -7
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +3 -3
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +6 -6
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +2 -2
- package/dist/esm/plugins/table/nodeviews/TableStickyScrollbar.js +3 -7
- package/dist/esm/plugins/table/nodeviews/table.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/table-analytics.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +68 -67
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/table/transforms/column-width.js +1 -1
- package/dist/esm/plugins/table/transforms/delete-columns.js +56 -55
- package/dist/esm/plugins/table/transforms/delete-rows.js +51 -50
- package/dist/esm/plugins/table/transforms/replace-table.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +20 -6
- package/dist/esm/plugins/table/ui/ui-styles.js +18 -10
- package/dist/esm/plugins/table/utils/analytics.js +1 -1
- package/dist/esm/plugins/table/utils/dom.js +1 -1
- package/dist/esm/plugins/table/utils/paste.js +4 -4
- package/dist/types/plugins/table/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +1 -0
- package/package.json +5 -2
- package/report.api.md +2 -0
- package/src/plugins/table/index.tsx +1 -1
- package/src/plugins/table/ui/common-styles.ts +46 -4
- package/src/plugins/table/ui/ui-styles.ts +235 -90
- package/tmp/api-report-tmp.d.ts +2 -0
|
@@ -30,7 +30,7 @@ var isFocusingModal = function isFocusingModal(event) {
|
|
|
30
30
|
var isFocusingFloatingToolbar = function isFocusingFloatingToolbar(event) {
|
|
31
31
|
return event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[role="toolbar"]');
|
|
32
32
|
};
|
|
33
|
-
var handleBlur = function handleBlur(view, event) {
|
|
33
|
+
var handleBlur = exports.handleBlur = function handleBlur(view, event) {
|
|
34
34
|
var state = view.state,
|
|
35
35
|
dispatch = view.dispatch;
|
|
36
36
|
// IE version check for ED-4665
|
|
@@ -41,16 +41,14 @@ var handleBlur = function handleBlur(view, event) {
|
|
|
41
41
|
event.preventDefault();
|
|
42
42
|
return false;
|
|
43
43
|
};
|
|
44
|
-
exports.
|
|
45
|
-
var handleFocus = function handleFocus(view, event) {
|
|
44
|
+
var handleFocus = exports.handleFocus = function handleFocus(view, event) {
|
|
46
45
|
var state = view.state,
|
|
47
46
|
dispatch = view.dispatch;
|
|
48
47
|
(0, _commands.setEditorFocus)(true)(state, dispatch);
|
|
49
48
|
event.preventDefault();
|
|
50
49
|
return false;
|
|
51
50
|
};
|
|
52
|
-
exports.
|
|
53
|
-
var handleClick = function handleClick(view, event) {
|
|
51
|
+
var handleClick = exports.handleClick = function handleClick(view, event) {
|
|
54
52
|
if (!(event.target instanceof HTMLElement)) {
|
|
55
53
|
return false;
|
|
56
54
|
}
|
|
@@ -96,8 +94,7 @@ var handleClick = function handleClick(view, event) {
|
|
|
96
94
|
}
|
|
97
95
|
return true;
|
|
98
96
|
};
|
|
99
|
-
exports.
|
|
100
|
-
var handleMouseOver = function handleMouseOver(view, mouseEvent) {
|
|
97
|
+
var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, mouseEvent) {
|
|
101
98
|
if (!(mouseEvent.target instanceof HTMLElement)) {
|
|
102
99
|
return false;
|
|
103
100
|
}
|
|
@@ -141,16 +138,14 @@ var handleMouseOver = function handleMouseOver(view, mouseEvent) {
|
|
|
141
138
|
|
|
142
139
|
// Ignore any `mousedown` `event` from control and numbered column buttons
|
|
143
140
|
// PM end up changing selection during shift selection if not prevented
|
|
144
|
-
exports.
|
|
145
|
-
var handleMouseDown = function handleMouseDown(_, event) {
|
|
141
|
+
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(_, event) {
|
|
146
142
|
var isControl = !!(event.target && event.target instanceof HTMLElement && ((0, _utils3.isTableContainerOrWrapper)(event.target) || (0, _utils3.isColumnControlsDecorations)(event.target) || (0, _utils3.isRowControlsButton)(event.target)));
|
|
147
143
|
if (isControl) {
|
|
148
144
|
event.preventDefault();
|
|
149
145
|
}
|
|
150
146
|
return isControl;
|
|
151
147
|
};
|
|
152
|
-
exports.
|
|
153
|
-
var handleMouseOut = function handleMouseOut(view, mouseEvent) {
|
|
148
|
+
var handleMouseOut = exports.handleMouseOut = function handleMouseOut(view, mouseEvent) {
|
|
154
149
|
if (!(mouseEvent instanceof MouseEvent) || !(mouseEvent.target instanceof HTMLElement)) {
|
|
155
150
|
return false;
|
|
156
151
|
}
|
|
@@ -170,8 +165,7 @@ var handleMouseOut = function handleMouseOut(view, mouseEvent) {
|
|
|
170
165
|
}
|
|
171
166
|
return false;
|
|
172
167
|
};
|
|
173
|
-
exports.
|
|
174
|
-
var handleMouseLeave = function handleMouseLeave(view, event) {
|
|
168
|
+
var handleMouseLeave = exports.handleMouseLeave = function handleMouseLeave(view, event) {
|
|
175
169
|
if (!(event.target instanceof HTMLElement)) {
|
|
176
170
|
return false;
|
|
177
171
|
}
|
|
@@ -189,8 +183,7 @@ var handleMouseLeave = function handleMouseLeave(view, event) {
|
|
|
189
183
|
}
|
|
190
184
|
return false;
|
|
191
185
|
};
|
|
192
|
-
exports.
|
|
193
|
-
var handleMouseMove = function handleMouseMove(view, event, elementContentRects) {
|
|
186
|
+
var handleMouseMove = exports.handleMouseMove = function handleMouseMove(view, event, elementContentRects) {
|
|
194
187
|
if (!(event.target instanceof HTMLElement)) {
|
|
195
188
|
return false;
|
|
196
189
|
}
|
|
@@ -248,7 +241,6 @@ var handleMouseMove = function handleMouseMove(view, event, elementContentRects)
|
|
|
248
241
|
}
|
|
249
242
|
return false;
|
|
250
243
|
};
|
|
251
|
-
exports.handleMouseMove = handleMouseMove;
|
|
252
244
|
function handleTripleClick(view, pos) {
|
|
253
245
|
var state = view.state,
|
|
254
246
|
dispatch = view.dispatch;
|
|
@@ -267,7 +259,7 @@ function handleTripleClick(view, pos) {
|
|
|
267
259
|
}
|
|
268
260
|
return false;
|
|
269
261
|
}
|
|
270
|
-
var handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI) {
|
|
262
|
+
var handleCut = exports.handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI) {
|
|
271
263
|
var oldSelection = oldState.tr.selection;
|
|
272
264
|
var tr = newState.tr;
|
|
273
265
|
if (oldSelection instanceof _cellSelection.CellSelection) {
|
|
@@ -286,7 +278,7 @@ var handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI
|
|
|
286
278
|
totalColumnCount = _getSelectedCellInfo.totalColumnCount;
|
|
287
279
|
|
|
288
280
|
// Reassigning to make it more obvious and consistent
|
|
289
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
281
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
290
282
|
action: _analytics.TABLE_ACTION.CUT,
|
|
291
283
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
292
284
|
actionSubjectId: null,
|
|
@@ -318,8 +310,7 @@ var handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI
|
|
|
318
310
|
}
|
|
319
311
|
return tr;
|
|
320
312
|
};
|
|
321
|
-
exports.
|
|
322
|
-
var whenTableInFocus = function whenTableInFocus(eventHandler, elementContentRects) {
|
|
313
|
+
var whenTableInFocus = exports.whenTableInFocus = function whenTableInFocus(eventHandler, elementContentRects) {
|
|
323
314
|
return function (view, mouseEvent) {
|
|
324
315
|
var _getPluginState7, _getResizePluginState;
|
|
325
316
|
if (!((_getPluginState7 = (0, _pluginFactory.getPluginState)(view.state)) !== null && _getPluginState7 !== void 0 && _getPluginState7.tableNode) || !!((_getResizePluginState = (0, _pluginFactory2.getPluginState)(view.state)) !== null && _getResizePluginState !== void 0 && _getResizePluginState.dragging)) {
|
|
@@ -327,5 +318,4 @@ var whenTableInFocus = function whenTableInFocus(eventHandler, elementContentRec
|
|
|
327
318
|
}
|
|
328
319
|
return eventHandler(view, mouseEvent, elementContentRects);
|
|
329
320
|
};
|
|
330
|
-
};
|
|
331
|
-
exports.whenTableInFocus = whenTableInFocus;
|
|
321
|
+
};
|
|
@@ -118,10 +118,9 @@ var buildPluginState = function buildPluginState(builders) {
|
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
|
-
var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, pluginState) {
|
|
121
|
+
var handleDocOrSelectionChanged = exports.handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, pluginState) {
|
|
122
122
|
return buildPluginState([updateTargetCellPosition, updateTableNodePluginState, updateCollapseHandler])({
|
|
123
123
|
tr: tr,
|
|
124
124
|
table: (0, _utils3.findTable)(tr.selection)
|
|
125
125
|
})(pluginState);
|
|
126
|
-
};
|
|
127
|
-
exports.handleDocOrSelectionChanged = handleDocOrSelectionChanged;
|
|
126
|
+
};
|
|
@@ -54,23 +54,23 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
54
54
|
current: null
|
|
55
55
|
};
|
|
56
56
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
57
|
-
var _document$body$offset, _document,
|
|
57
|
+
var _document$body$offset, _document, _api$width$sharedStat;
|
|
58
58
|
var defaultState = {
|
|
59
|
-
width: (_document$body$offset = (_document = document) === null || _document === void 0
|
|
59
|
+
width: (_document$body$offset = (_document = document) === null || _document === void 0 || (_document = _document.body) === null || _document === void 0 ? void 0 : _document.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
|
|
60
60
|
};
|
|
61
61
|
return (_api$width$sharedStat = api === null || api === void 0 ? void 0 : api.width.sharedState.currentState()) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : defaultState;
|
|
62
62
|
};
|
|
63
|
-
var editorAnalyticsAPI = api === null || api === void 0
|
|
63
|
+
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
64
64
|
return {
|
|
65
65
|
name: 'table',
|
|
66
66
|
actions: {
|
|
67
67
|
insertTable: function insertTable(analyticsPayload) {
|
|
68
68
|
return function (state, dispatch) {
|
|
69
|
-
var _api$contentInsertion, _api$contentInsertion2
|
|
69
|
+
var _api$contentInsertion, _api$contentInsertion2;
|
|
70
70
|
var node = (0, _utils2.createTable)({
|
|
71
71
|
schema: state.schema
|
|
72
72
|
});
|
|
73
|
-
return (_api$contentInsertion = api === null || api === void 0
|
|
73
|
+
return (_api$contentInsertion = api === null || api === void 0 || (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 || (_api$contentInsertion2 = _api$contentInsertion2.actions) === null || _api$contentInsertion2 === void 0 ? void 0 : _api$contentInsertion2.insert({
|
|
74
74
|
state: state,
|
|
75
75
|
dispatch: dispatch,
|
|
76
76
|
node: node,
|
|
@@ -155,7 +155,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
155
155
|
reportFixedTable: function reportFixedTable(_ref6) {
|
|
156
156
|
var tr = _ref6.tr,
|
|
157
157
|
reason = _ref6.reason;
|
|
158
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
158
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
159
159
|
action: _analytics.TABLE_ACTION.FIXED,
|
|
160
160
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
161
161
|
actionSubjectId: null,
|
|
@@ -347,7 +347,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
347
347
|
var tr = insert((0, _utils2.createTable)({
|
|
348
348
|
schema: state.schema
|
|
349
349
|
}));
|
|
350
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
350
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
351
351
|
action: _analytics.ACTION.INSERTED,
|
|
352
352
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
353
353
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
@@ -366,5 +366,4 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
368
|
};
|
|
369
|
-
var _default = tablesPlugin;
|
|
370
|
-
exports.default = _default;
|
|
369
|
+
var _default = exports.default = tablesPlugin;
|
|
@@ -12,7 +12,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
12
12
|
var _types = require("../types");
|
|
13
13
|
var _consts = require("../ui/consts");
|
|
14
14
|
var _updateOverflowShadows = require("./update-overflow-shadows");
|
|
15
|
-
var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
15
|
+
var OverflowShadowsObserver = exports.OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
16
16
|
// updateShadowState is a method to update shadow key
|
|
17
17
|
function OverflowShadowsObserver(updateShadowState, _table, wrapper) {
|
|
18
18
|
var _this = this;
|
|
@@ -68,7 +68,7 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
68
68
|
* reading it from sticky cell
|
|
69
69
|
*/
|
|
70
70
|
(0, _defineProperty2.default)(this, "updateStickyShadows", function (stickyRowHeight) {
|
|
71
|
-
var _this$wrapper, _this$wrapper2, _this$
|
|
71
|
+
var _this$wrapper, _this$wrapper2, _this$wrapper3;
|
|
72
72
|
if (!_this.isSticky) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
@@ -79,8 +79,8 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
79
79
|
var heightStyleOrCompute = "".concat(stickyRowHeight || stickyCell.clientHeight + 1, "px");
|
|
80
80
|
// Use getElementsByClassName here for a live node list to capture
|
|
81
81
|
// sticky shadows
|
|
82
|
-
var liveRightShadows = (_this$wrapper2 = _this.wrapper) === null || _this$wrapper2 === void 0
|
|
83
|
-
var liveLeftShadows = (_this$wrapper3 = _this.wrapper) === null || _this$wrapper3 === void 0
|
|
82
|
+
var liveRightShadows = (_this$wrapper2 = _this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.getElementsByClassName("".concat(_types.TableCssClassName.TABLE_RIGHT_SHADOW));
|
|
83
|
+
var liveLeftShadows = (_this$wrapper3 = _this.wrapper) === null || _this$wrapper3 === void 0 || (_this$wrapper3 = _this$wrapper3.parentElement) === null || _this$wrapper3 === void 0 ? void 0 : _this$wrapper3.getElementsByClassName("".concat(_types.TableCssClassName.TABLE_LEFT_SHADOW));
|
|
84
84
|
(0, _updateOverflowShadows.updateShadowListForStickyStyles)(heightStyleOrCompute, liveLeftShadows);
|
|
85
85
|
(0, _updateOverflowShadows.updateShadowListForStickyStyles)(heightStyleOrCompute, liveRightShadows);
|
|
86
86
|
});
|
|
@@ -123,5 +123,4 @@ var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
123
123
|
}
|
|
124
124
|
}]);
|
|
125
125
|
return OverflowShadowsObserver;
|
|
126
|
-
}();
|
|
127
|
-
exports.OverflowShadowsObserver = OverflowShadowsObserver;
|
|
126
|
+
}();
|
|
@@ -242,7 +242,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
242
242
|
var prevNode = _this.node;
|
|
243
243
|
var layoutSize = _this.tableNodeLayoutSize(node);
|
|
244
244
|
var prevAttrs = prevNode === null || prevNode === void 0 ? void 0 : prevNode.attrs;
|
|
245
|
-
var layoutChanged = (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.layout) !== (node === null || node === void 0
|
|
245
|
+
var layoutChanged = (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.layout) !== (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) && (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.__autoSize) === (node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.__autoSize);
|
|
246
246
|
if (containerWidth.width > layoutSize) {
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
@@ -588,5 +588,4 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
588
588
|
return TableComponent;
|
|
589
589
|
}(_react.default.Component);
|
|
590
590
|
(0, _defineProperty3.default)(TableComponent, "displayName", 'TableComponent');
|
|
591
|
-
var _default = TableComponent;
|
|
592
|
-
exports.default = _default;
|
|
591
|
+
var _default = exports.default = TableComponent;
|
|
@@ -30,7 +30,7 @@ var getMarginLeft = function getMarginLeft(lineLength, tableWidth) {
|
|
|
30
30
|
}
|
|
31
31
|
return marginLeft;
|
|
32
32
|
};
|
|
33
|
-
var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
|
+
var InnerContainer = exports.InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
34
34
|
var className = _ref.className,
|
|
35
35
|
style = _ref.style,
|
|
36
36
|
node = _ref.node,
|
|
@@ -44,8 +44,7 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
44
44
|
"data-test-id": "table-container"
|
|
45
45
|
}, children);
|
|
46
46
|
});
|
|
47
|
-
exports.
|
|
48
|
-
var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
47
|
+
var ResizableTableContainer = exports.ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
49
48
|
var children = _ref2.children,
|
|
50
49
|
className = _ref2.className,
|
|
51
50
|
node = _ref2.node,
|
|
@@ -72,11 +71,11 @@ var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
|
72
71
|
// 1px is border width but collapse make it 0.5.
|
|
73
72
|
// -- When sticky header appear, we should add first row height but reduce
|
|
74
73
|
// collapsed border
|
|
75
|
-
(_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0
|
|
74
|
+
(_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 || _containerRef$current2.style.setProperty('height', typeof height === 'number' ? "".concat(height + 40.5, "px") : 'auto');
|
|
76
75
|
} else {
|
|
77
76
|
var _containerRef$current3, _containerRef$current4;
|
|
78
77
|
var stickyHeaderHeight = ((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.getElementsByTagName('th')[0].getBoundingClientRect().height) || 0;
|
|
79
|
-
(_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0
|
|
78
|
+
(_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 || _containerRef$current4.style.setProperty('height', typeof height === 'number' ? "".concat(height + stickyHeaderHeight + 39.5, "px") : 'auto');
|
|
80
79
|
}
|
|
81
80
|
}, []);
|
|
82
81
|
var resizeObserverRef = (0, _react.useRef)(new ResizeObserver(function (entries) {
|
|
@@ -112,18 +111,18 @@ var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
|
112
111
|
}
|
|
113
112
|
}, [lineLength]);
|
|
114
113
|
var displayGuideline = (0, _react.useCallback)(function (guidelines) {
|
|
115
|
-
var _pluginInjectionApi$g, _pluginInjectionApi$g2
|
|
116
|
-
return (_pluginInjectionApi$g = pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
114
|
+
var _pluginInjectionApi$g, _pluginInjectionApi$g2;
|
|
115
|
+
return (_pluginInjectionApi$g = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$g2 = pluginInjectionApi.guideline) === null || _pluginInjectionApi$g2 === void 0 || (_pluginInjectionApi$g2 = _pluginInjectionApi$g2.actions) === null || _pluginInjectionApi$g2 === void 0 ? void 0 : _pluginInjectionApi$g2.displayGuideline(editorView)({
|
|
117
116
|
guidelines: guidelines
|
|
118
117
|
})) !== null && _pluginInjectionApi$g !== void 0 ? _pluginInjectionApi$g : false;
|
|
119
118
|
}, [pluginInjectionApi, editorView]);
|
|
120
119
|
var attachAnalyticsEvent = (0, _react.useCallback)(function (payload) {
|
|
121
120
|
var _pluginInjectionApi$a;
|
|
122
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
121
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.attachAnalyticsEvent(payload);
|
|
123
122
|
}, [pluginInjectionApi]);
|
|
124
123
|
var displayGapCursor = (0, _react.useCallback)(function (toggle) {
|
|
125
124
|
var _pluginInjectionApi$c, _pluginInjectionApi$c2, _pluginInjectionApi$s;
|
|
126
|
-
return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
125
|
+
return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.core) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s = pluginInjectionApi.selection) === null || _pluginInjectionApi$s === void 0 ? void 0 : _pluginInjectionApi$s.commands.displayGapCursor(toggle))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
|
|
127
126
|
}, [pluginInjectionApi]);
|
|
128
127
|
var tableWidth = (0, _nodeWidth.getTableContainerWidth)(node);
|
|
129
128
|
// 76 is currently an accepted padding value considering the spacing for resizer handle
|
|
@@ -165,8 +164,7 @@ var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
|
165
164
|
node: node
|
|
166
165
|
}, children)));
|
|
167
166
|
};
|
|
168
|
-
exports.
|
|
169
|
-
var TableContainer = function TableContainer(_ref3) {
|
|
167
|
+
var TableContainer = exports.TableContainer = function TableContainer(_ref3) {
|
|
170
168
|
var children = _ref3.children,
|
|
171
169
|
node = _ref3.node,
|
|
172
170
|
className = _ref3.className,
|
|
@@ -205,5 +203,4 @@ var TableContainer = function TableContainer(_ref3) {
|
|
|
205
203
|
marginLeft: getMarginLeft(lineLength, tableWidth)
|
|
206
204
|
}
|
|
207
205
|
}, children);
|
|
208
|
-
};
|
|
209
|
-
exports.TableContainer = TableContainer;
|
|
206
|
+
};
|
|
@@ -83,7 +83,7 @@ var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWi
|
|
|
83
83
|
return guideline.position && guideline.position.x !== undefined && typeof guideline.position.x === 'number' && Math.abs(guideline.position.x * 2) < containerWidth;
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
var TableResizer = function TableResizer(_ref) {
|
|
86
|
+
var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
87
87
|
var _findTable, _editorView$state;
|
|
88
88
|
var children = _ref.children,
|
|
89
89
|
width = _ref.width,
|
|
@@ -208,7 +208,7 @@ var TableResizer = function TableResizer(_ref) {
|
|
|
208
208
|
});
|
|
209
209
|
resizeFrameRatePayloads.forEach(function (payload) {
|
|
210
210
|
var _attachAnalyticsEvent;
|
|
211
|
-
(_attachAnalyticsEvent = attachAnalyticsEvent(payload)) === null || _attachAnalyticsEvent === void 0
|
|
211
|
+
(_attachAnalyticsEvent = attachAnalyticsEvent(payload)) === null || _attachAnalyticsEvent === void 0 || _attachAnalyticsEvent(tr);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
if (typeof pos === 'number') {
|
|
@@ -227,7 +227,7 @@ var TableResizer = function TableResizer(_ref) {
|
|
|
227
227
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent((0, _analytics2.generateResizedPayload)({
|
|
228
228
|
originalNode: node,
|
|
229
229
|
resizedNode: scaledNode
|
|
230
|
-
}))) === null || _attachAnalyticsEvent2 === void 0
|
|
230
|
+
}))) === null || _attachAnalyticsEvent2 === void 0 || _attachAnalyticsEvent2(tr);
|
|
231
231
|
}
|
|
232
232
|
displayGapCursor(true);
|
|
233
233
|
dispatch(tr);
|
|
@@ -262,5 +262,4 @@ var TableResizer = function TableResizer(_ref) {
|
|
|
262
262
|
handleHighlight: "shadow",
|
|
263
263
|
handleTooltipContent: formatMessage(messages.resizeTable)
|
|
264
264
|
}, children);
|
|
265
|
-
};
|
|
266
|
-
exports.TableResizer = TableResizer;
|
|
265
|
+
};
|
|
@@ -11,7 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
13
|
var _types = require("../types");
|
|
14
|
-
var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
14
|
+
var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function () {
|
|
15
15
|
function TableStickyScrollbar(wrapper, view) {
|
|
16
16
|
var _this = this;
|
|
17
17
|
(0, _classCallCheck2.default)(this, TableStickyScrollbar);
|
|
@@ -63,11 +63,7 @@ var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
63
63
|
value: function createIntersectionObserver() {
|
|
64
64
|
var _this2 = this,
|
|
65
65
|
_this$wrapper,
|
|
66
|
-
_this$
|
|
67
|
-
_this$wrapper$parentE3,
|
|
68
|
-
_this$wrapper2,
|
|
69
|
-
_this$wrapper2$parent,
|
|
70
|
-
_this$wrapper2$parent2;
|
|
66
|
+
_this$wrapper2;
|
|
71
67
|
this.editorScrollableElement = (0, _ui.findOverflowScrollParent)(this.view.dom) || window.document;
|
|
72
68
|
if (!this.editorScrollableElement || !this.wrapper) {
|
|
73
69
|
return;
|
|
@@ -93,8 +89,8 @@ var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
93
89
|
}, {
|
|
94
90
|
root: this.editorScrollableElement
|
|
95
91
|
});
|
|
96
|
-
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0
|
|
97
|
-
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0
|
|
92
|
+
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.item(0);
|
|
93
|
+
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
|
|
98
94
|
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
99
95
|
return _this2.intersectionObserver.observe(el);
|
|
100
96
|
});
|
|
@@ -150,5 +146,4 @@ var TableStickyScrollbar = /*#__PURE__*/function () {
|
|
|
150
146
|
}
|
|
151
147
|
}]);
|
|
152
148
|
return TableStickyScrollbar;
|
|
153
|
-
}();
|
|
154
|
-
exports.TableStickyScrollbar = TableStickyScrollbar;
|
|
149
|
+
}();
|
|
@@ -65,7 +65,7 @@ var toDOM = function toDOM(node, props) {
|
|
|
65
65
|
}
|
|
66
66
|
return ['table', tableAttributes(node), colgroup, ['tbody', 0]];
|
|
67
67
|
};
|
|
68
|
-
var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
68
|
+
var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
69
69
|
(0, _inherits2.default)(TableView, _ReactNodeView);
|
|
70
70
|
var _super = _createSuper(TableView);
|
|
71
71
|
function TableView(props) {
|
|
@@ -242,14 +242,13 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
242
242
|
if (this.resizeObserver) {
|
|
243
243
|
this.resizeObserver.disconnect();
|
|
244
244
|
}
|
|
245
|
-
(_this$eventDispatcher = this.eventDispatcher) === null || _this$eventDispatcher === void 0
|
|
245
|
+
(_this$eventDispatcher = this.eventDispatcher) === null || _this$eventDispatcher === void 0 || _this$eventDispatcher.emit('TABLE_DELETED', this.node);
|
|
246
246
|
(0, _get2.default)((0, _getPrototypeOf2.default)(TableView.prototype), "destroy", this).call(this);
|
|
247
247
|
}
|
|
248
248
|
}]);
|
|
249
249
|
return TableView;
|
|
250
250
|
}(_reactNodeView.default);
|
|
251
|
-
exports.
|
|
252
|
-
var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi) {
|
|
251
|
+
var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi) {
|
|
253
252
|
var _getPluginState2 = (0, _pluginFactory.getPluginState)(view.state),
|
|
254
253
|
pluginConfig = _getPluginState2.pluginConfig,
|
|
255
254
|
isBreakoutEnabled = _getPluginState2.isBreakoutEnabled,
|
|
@@ -277,5 +276,4 @@ var createTableView = function createTableView(node, view, getPos, portalProvide
|
|
|
277
276
|
hasIntlContext: hasIntlContext,
|
|
278
277
|
pluginInjectionApi: pluginInjectionApi
|
|
279
278
|
}).init();
|
|
280
|
-
};
|
|
281
|
-
exports.createTableView = createTableView;
|
|
279
|
+
};
|
|
@@ -13,7 +13,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
13
13
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
var DEFAULT_COL_SPAN = 1;
|
|
15
15
|
var DEFAULT_ROW_SPAN = 1;
|
|
16
|
-
var TableCellNodeView = /*#__PURE__*/function () {
|
|
16
|
+
var TableCellNodeView = exports.default = /*#__PURE__*/function () {
|
|
17
17
|
function TableCellNodeView(node, view, getPos, observer) {
|
|
18
18
|
(0, _classCallCheck2.default)(this, TableCellNodeView);
|
|
19
19
|
this.view = view;
|
|
@@ -96,5 +96,4 @@ var TableCellNodeView = /*#__PURE__*/function () {
|
|
|
96
96
|
}
|
|
97
97
|
}]);
|
|
98
98
|
return TableCellNodeView;
|
|
99
|
-
}();
|
|
100
|
-
exports.default = TableCellNodeView;
|
|
99
|
+
}();
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.updateShadowListForStickyStyles = void 0;
|
|
7
7
|
var _types = require("../types");
|
|
8
|
-
var updateShadowListForStickyStyles = function updateShadowListForStickyStyles(heightStyle, shadows) {
|
|
8
|
+
var updateShadowListForStickyStyles = exports.updateShadowListForStickyStyles = function updateShadowListForStickyStyles(heightStyle, shadows) {
|
|
9
9
|
Array.from(shadows).forEach(function (shadow) {
|
|
10
10
|
if (shadow.classList.contains(_types.TableCssClassName.TABLE_STICKY_SHADOW)) {
|
|
11
11
|
if (shadow instanceof HTMLElement && shadow.style.height !== heightStyle) {
|
|
@@ -13,5 +13,4 @@ var updateShadowListForStickyStyles = function updateShadowListForStickyStyles(h
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
};
|
|
17
|
-
exports.updateShadowListForStickyStyles = updateShadowListForStickyStyles;
|
|
16
|
+
};
|
|
@@ -11,13 +11,11 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
11
11
|
var _pluginKey = require("../plugin-key");
|
|
12
12
|
var _tableWidth = require("../table-width");
|
|
13
13
|
var _utils = require("./utils");
|
|
14
|
-
var pluginKey = new _state.PluginKey('tableDecorationsPlugin');
|
|
15
|
-
exports.
|
|
16
|
-
var getDecorations = function getDecorations(state) {
|
|
14
|
+
var pluginKey = exports.pluginKey = new _state.PluginKey('tableDecorationsPlugin');
|
|
15
|
+
var getDecorations = exports.getDecorations = function getDecorations(state) {
|
|
17
16
|
return pluginKey.getState(state);
|
|
18
17
|
};
|
|
19
|
-
exports.
|
|
20
|
-
var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState) {
|
|
18
|
+
var handleDocOrSelectionChanged = exports.handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState) {
|
|
21
19
|
var _tableWidthPluginKey$, _tableWidthPluginKey$2;
|
|
22
20
|
var isResizing = (_tableWidthPluginKey$ = _tableWidth.pluginKey.getState(newState)) === null || _tableWidthPluginKey$ === void 0 ? void 0 : _tableWidthPluginKey$.resizing;
|
|
23
21
|
var wasResizing = (_tableWidthPluginKey$2 = _tableWidth.pluginKey.getState(oldState)) === null || _tableWidthPluginKey$2 === void 0 ? void 0 : _tableWidthPluginKey$2.resizing;
|
|
@@ -42,8 +40,7 @@ var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decor
|
|
|
42
40
|
}
|
|
43
41
|
return decorationSet;
|
|
44
42
|
};
|
|
45
|
-
exports.
|
|
46
|
-
var createPlugin = function createPlugin() {
|
|
43
|
+
var createPlugin = exports.createPlugin = function createPlugin() {
|
|
47
44
|
return new _safePlugin.SafePlugin({
|
|
48
45
|
state: {
|
|
49
46
|
init: function init() {
|
|
@@ -69,5 +66,4 @@ var createPlugin = function createPlugin() {
|
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
});
|
|
72
|
-
};
|
|
73
|
-
exports.createPlugin = createPlugin;
|
|
69
|
+
};
|
|
@@ -46,7 +46,7 @@ var removeColumnControlsSelectedDecoration = function removeColumnControlsSelect
|
|
|
46
46
|
var hasColumnSelectedDecorations = function hasColumnSelectedDecorations(decorationSet) {
|
|
47
47
|
return !!(0, _decoration.findColumnControlSelectedDecoration)(decorationSet).length;
|
|
48
48
|
};
|
|
49
|
-
var maybeUpdateColumnControlsSelectedDecoration = function maybeUpdateColumnControlsSelectedDecoration(_ref5) {
|
|
49
|
+
var maybeUpdateColumnControlsSelectedDecoration = exports.maybeUpdateColumnControlsSelectedDecoration = function maybeUpdateColumnControlsSelectedDecoration(_ref5) {
|
|
50
50
|
var decorationSet = _ref5.decorationSet,
|
|
51
51
|
tr = _ref5.tr;
|
|
52
52
|
if (!hasColumnSelectedDecorations(decorationSet)) {
|
|
@@ -57,13 +57,11 @@ var maybeUpdateColumnControlsSelectedDecoration = function maybeUpdateColumnCont
|
|
|
57
57
|
tr: tr
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
|
-
exports.
|
|
61
|
-
var buildColumnControlsDecorations = function buildColumnControlsDecorations(_ref6) {
|
|
60
|
+
var buildColumnControlsDecorations = exports.buildColumnControlsDecorations = function buildColumnControlsDecorations(_ref6) {
|
|
62
61
|
var decorationSet = _ref6.decorationSet,
|
|
63
62
|
tr = _ref6.tr;
|
|
64
63
|
return (0, _composeDecorations.composeDecorations)([removeColumnControlsSelectedDecoration, removeControlsHoverDecoration, maybeUpdateColumnSelectedDecoration, maybeUpdateColumnControlsDecoration])({
|
|
65
64
|
decorationSet: decorationSet,
|
|
66
65
|
tr: tr
|
|
67
66
|
});
|
|
68
|
-
};
|
|
69
|
-
exports.buildColumnControlsDecorations = buildColumnControlsDecorations;
|
|
67
|
+
};
|
|
@@ -24,7 +24,7 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
|
|
|
24
24
|
return (0, _decoration.updateDecorations)(tr.doc, decorationSet, lastCellElementsDecorations, _types.TableDecorations.LAST_CELL_ELEMENT);
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl) {
|
|
27
|
+
var buildColumnResizingDecorations = exports.buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl) {
|
|
28
28
|
return function (_ref3) {
|
|
29
29
|
var tr = _ref3.tr,
|
|
30
30
|
decorationSet = _ref3.decorationSet;
|
|
@@ -40,8 +40,7 @@ var buildColumnResizingDecorations = function buildColumnResizingDecorations(row
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
exports.
|
|
44
|
-
var clearColumnResizingDecorations = function clearColumnResizingDecorations() {
|
|
43
|
+
var clearColumnResizingDecorations = exports.clearColumnResizingDecorations = function clearColumnResizingDecorations() {
|
|
45
44
|
return function (_ref6) {
|
|
46
45
|
var tr = _ref6.tr,
|
|
47
46
|
decorationSet = _ref6.decorationSet;
|
|
@@ -52,5 +51,4 @@ var clearColumnResizingDecorations = function clearColumnResizingDecorations() {
|
|
|
52
51
|
tr: tr
|
|
53
52
|
});
|
|
54
53
|
};
|
|
55
|
-
};
|
|
56
|
-
exports.clearColumnResizingDecorations = clearColumnResizingDecorations;
|
|
54
|
+
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.composeDecorations = void 0;
|
|
7
|
-
var composeDecorations = function composeDecorations(transformers) {
|
|
7
|
+
var composeDecorations = exports.composeDecorations = function composeDecorations(transformers) {
|
|
8
8
|
return function (_ref) {
|
|
9
9
|
var decorationSet = _ref.decorationSet,
|
|
10
10
|
tr = _ref.tr;
|
|
@@ -15,5 +15,4 @@ var composeDecorations = function composeDecorations(transformers) {
|
|
|
15
15
|
});
|
|
16
16
|
}, decorationSet);
|
|
17
17
|
};
|
|
18
|
-
};
|
|
19
|
-
exports.composeDecorations = composeDecorations;
|
|
18
|
+
};
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultTableSelection = void 0;
|
|
7
|
-
var defaultTableSelection = {
|
|
7
|
+
var defaultTableSelection = exports.defaultTableSelection = {
|
|
8
8
|
hoveredColumns: [],
|
|
9
9
|
hoveredRows: []
|
|
10
|
-
};
|
|
11
|
-
exports.defaultTableSelection = defaultTableSelection;
|
|
10
|
+
};
|
|
@@ -39,5 +39,4 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
|
39
39
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(getEditorContainerWidth), list);
|
|
40
40
|
return (0, _keymap.keymap)(list);
|
|
41
41
|
}
|
|
42
|
-
var _default = keymapPlugin;
|
|
43
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = keymapPlugin;
|
|
@@ -29,7 +29,7 @@ var _pluginFactory = require("./plugin-factory");
|
|
|
29
29
|
var _pluginKey = require("./plugin-key");
|
|
30
30
|
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; }
|
|
31
31
|
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; }
|
|
32
|
-
var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
|
|
32
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
|
|
33
33
|
var _window;
|
|
34
34
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread({
|
|
35
35
|
pluginConfig: pluginConfig,
|
|
@@ -254,5 +254,4 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
254
254
|
handleTripleClick: _eventHandlers.handleTripleClick
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
|
-
};
|
|
258
|
-
exports.createPlugin = createPlugin;
|
|
257
|
+
};
|
|
@@ -40,9 +40,6 @@ var _pluginFactory = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.de
|
|
|
40
40
|
onDocChanged: _handlers.handleDocOrSelectionChanged,
|
|
41
41
|
onSelectionChanged: _handlers.handleDocOrSelectionChanged
|
|
42
42
|
}),
|
|
43
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
44
|
-
createCommand = _pluginFactory.createCommand,
|
|
45
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
46
|
-
exports.getPluginState = getPluginState;
|
|
47
|
-
exports.createCommand = createCommand;
|
|
48
|
-
exports.createPluginState = createPluginState;
|
|
43
|
+
createPluginState = exports.createPluginState = _pluginFactory.createPluginState,
|
|
44
|
+
createCommand = exports.createCommand = _pluginFactory.createCommand,
|
|
45
|
+
getPluginState = exports.getPluginState = _pluginFactory.getPluginState;
|
|
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.pluginKey = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var pluginKey = new _state.PluginKey('tablePlugin');
|
|
9
|
-
exports.pluginKey = pluginKey;
|
|
8
|
+
var pluginKey = exports.pluginKey = new _state.PluginKey('tablePlugin');
|