@atlaskit/editor-plugin-table 15.4.10 → 15.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/cjs/pm-plugins/analytics/plugin.js +0 -8
- package/dist/cjs/pm-plugins/decorations/plugin.js +0 -6
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/cjs/pm-plugins/handlers.js +1 -8
- package/dist/cjs/pm-plugins/main.js +0 -23
- package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/cjs/pm-plugins/table-analytics.js +0 -7
- package/dist/cjs/pm-plugins/table-local-id.js +0 -17
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +0 -4
- package/dist/cjs/pm-plugins/table-size-selector.js +0 -4
- package/dist/cjs/pm-plugins/table-width-in-comment-fix.js +0 -7
- package/dist/cjs/pm-plugins/table-width.js +0 -17
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +0 -40
- package/dist/cjs/tablePlugin.js +0 -2
- package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/es2019/pm-plugins/analytics/plugin.js +0 -8
- package/dist/es2019/pm-plugins/decorations/plugin.js +0 -6
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/es2019/pm-plugins/handlers.js +1 -8
- package/dist/es2019/pm-plugins/main.js +0 -24
- package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/es2019/pm-plugins/table-analytics.js +0 -9
- package/dist/es2019/pm-plugins/table-local-id.js +0 -20
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +0 -6
- package/dist/es2019/pm-plugins/table-size-selector.js +0 -4
- package/dist/es2019/pm-plugins/table-width-in-comment-fix.js +0 -10
- package/dist/es2019/pm-plugins/table-width.js +0 -19
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +0 -42
- package/dist/es2019/tablePlugin.js +0 -2
- package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/esm/pm-plugins/analytics/plugin.js +0 -8
- package/dist/esm/pm-plugins/decorations/plugin.js +0 -6
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/esm/pm-plugins/handlers.js +1 -8
- package/dist/esm/pm-plugins/main.js +0 -23
- package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/esm/pm-plugins/table-analytics.js +0 -7
- package/dist/esm/pm-plugins/table-local-id.js +0 -17
- package/dist/esm/pm-plugins/table-resizing/plugin.js +0 -4
- package/dist/esm/pm-plugins/table-size-selector.js +0 -4
- package/dist/esm/pm-plugins/table-width-in-comment-fix.js +0 -7
- package/dist/esm/pm-plugins/table-width.js +0 -17
- package/dist/esm/pm-plugins/view-mode-sort/index.js +0 -40
- package/dist/esm/tablePlugin.js +0 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 15.4.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e3779b75fdeca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3779b75fdeca) -
|
|
8
|
+
EDITOR-1643 Promote syncBlock and bodiedSyncBlock to full schema
|
|
9
|
+
- [`a3a20e1d45d82`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3a20e1d45d82) -
|
|
10
|
+
Fix table col control positioning for new dnd anchor experiment
|
|
11
|
+
- [`7eedf0747e9e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7eedf0747e9e2) -
|
|
12
|
+
Fix table sticky header detection
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 15.4.11
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
|
|
20
|
+
tsignores added for help-center local consumpton removed
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 15.4.10
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -18,6 +18,7 @@ var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
|
|
|
18
18
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
19
19
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
20
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
22
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
22
23
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
23
24
|
var _commands = require("../pm-plugins/sticky-headers/commands");
|
|
@@ -323,7 +324,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
|
|
|
323
324
|
}
|
|
324
325
|
var options = {
|
|
325
326
|
root: this.editorScrollableElement,
|
|
326
|
-
rootMargin: "-".concat(_styles.tableMarginTop +
|
|
327
|
+
rootMargin: "-".concat(_styles.tableMarginTop + 1, "px 0px 0px 0px"),
|
|
327
328
|
threshold: 1
|
|
328
329
|
};
|
|
329
330
|
this.stickyStateObserver = new IntersectionObserver(function (entries) {
|
|
@@ -361,6 +362,10 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
|
|
|
361
362
|
}
|
|
362
363
|
if (this.isHeaderRow && !this.isInNestedTable) {
|
|
363
364
|
var _this$stickyStateObse;
|
|
365
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
|
|
366
|
+
var _this$dom$getAttribut;
|
|
367
|
+
this.dom.style.setProperty('anchor-name', (_this$dom$getAttribut = this.dom.getAttribute('data-node-anchor')) !== null && _this$dom$getAttribut !== void 0 ? _this$dom$getAttribut : '');
|
|
368
|
+
}
|
|
364
369
|
this.initOverflowObserver();
|
|
365
370
|
var closestTable = this.dom.closest('table');
|
|
366
371
|
if (closestTable) {
|
|
@@ -15,11 +15,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
15
15
|
return new _safePlugin.SafePlugin({
|
|
16
16
|
key: _pluginKey.pluginKey,
|
|
17
17
|
state: (0, _pluginFactory.createPluginState)(dispatch, _types.defaultState),
|
|
18
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
19
|
-
|
|
20
18
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
21
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
22
|
-
|
|
23
19
|
var tr = transactions.find(function (tr) {
|
|
24
20
|
var _tr$getMeta;
|
|
25
21
|
return (_tr$getMeta = tr.getMeta(_pluginKey.pluginKey)) === null || _tr$getMeta === void 0 || (_tr$getMeta = _tr$getMeta.data) === null || _tr$getMeta === void 0 || (_tr$getMeta = _tr$getMeta.currentActions) === null || _tr$getMeta === void 0 ? void 0 : _tr$getMeta.includes('pasted');
|
|
@@ -41,8 +37,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
41
37
|
return undefined;
|
|
42
38
|
},
|
|
43
39
|
props: {
|
|
44
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
45
|
-
|
|
46
40
|
handlePaste: function handlePaste(_ref, event, slice) {
|
|
47
41
|
var state = _ref.state,
|
|
48
42
|
dispatch = _ref.dispatch;
|
|
@@ -59,8 +53,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
59
53
|
type: type
|
|
60
54
|
}, 'pasted')(state, dispatch);
|
|
61
55
|
},
|
|
62
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
63
|
-
|
|
64
56
|
transformCopied: function transformCopied(slice, _ref2) {
|
|
65
57
|
var state = _ref2.state,
|
|
66
58
|
dispatch = _ref2.dispatch;
|
|
@@ -67,8 +67,6 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
67
67
|
init: function init() {
|
|
68
68
|
return _view.DecorationSet.empty;
|
|
69
69
|
},
|
|
70
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
71
|
-
|
|
72
70
|
apply: function apply(tr, decorationSet, oldState, newState) {
|
|
73
71
|
var pluginState = decorationSet;
|
|
74
72
|
// main table plugin --->
|
|
@@ -77,8 +75,6 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
77
75
|
pluginState = meta.data.decorationSet;
|
|
78
76
|
}
|
|
79
77
|
if (tr.docChanged || tr.selectionSet || tr.getMeta(_tableWidth.pluginKey)) {
|
|
80
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
81
|
-
|
|
82
78
|
pluginState = pluginState.map(tr.mapping, tr.doc);
|
|
83
79
|
return handleDocOrSelectionChanged(tr, pluginState, oldState, newState);
|
|
84
80
|
}
|
|
@@ -87,8 +83,6 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
87
83
|
},
|
|
88
84
|
key: pluginKey,
|
|
89
85
|
props: {
|
|
90
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
91
|
-
|
|
92
86
|
decorations: function decorations(state) {
|
|
93
87
|
return getDecorations(state);
|
|
94
88
|
}
|
|
@@ -238,8 +238,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
238
238
|
};
|
|
239
239
|
}),
|
|
240
240
|
key: _pluginKey2.pluginKey,
|
|
241
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
242
|
-
|
|
243
241
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
244
242
|
var _getTablePluginState4 = (0, _pluginFactory.getPluginState)(oldState),
|
|
245
243
|
oldTargetCellPosition = _getTablePluginState4.targetCellPosition;
|
|
@@ -249,9 +247,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
249
247
|
_getPluginState$isDra = _getPluginState.isDragMenuOpen,
|
|
250
248
|
isDragMenuOpen = _getPluginState$isDra === void 0 ? false : _getPluginState$isDra,
|
|
251
249
|
dragMenuIndex = _getPluginState.dragMenuIndex;
|
|
252
|
-
|
|
253
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
254
|
-
|
|
255
250
|
transactions.forEach(function (transaction) {
|
|
256
251
|
if (transaction.getMeta('selectedRowViaKeyboard')) {
|
|
257
252
|
var button = document.querySelector('#drag-handle-button-row');
|
|
@@ -302,15 +297,11 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
302
297
|
};
|
|
303
298
|
},
|
|
304
299
|
props: {
|
|
305
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
306
|
-
|
|
307
300
|
decorations: function decorations(state) {
|
|
308
301
|
var _getPluginState2 = (0, _pluginFactory2.getPluginState)(state),
|
|
309
302
|
decorationSet = _getPluginState2.decorationSet;
|
|
310
303
|
return decorationSet;
|
|
311
304
|
},
|
|
312
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
313
|
-
|
|
314
305
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
315
306
|
var _ref8;
|
|
316
307
|
var tr = view.state.tr;
|
|
@@ -18,12 +18,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
18
18
|
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; } // #region Imports
|
|
19
19
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
20
20
|
var nextTableSorting = function nextTableSorting(tr, table) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var tableSortStep = tr.steps.find(
|
|
24
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
25
|
-
|
|
26
|
-
function (step) {
|
|
21
|
+
var tableSortStep = tr.steps.find(function (step) {
|
|
27
22
|
return step instanceof _customSteps.TableSortStep;
|
|
28
23
|
});
|
|
29
24
|
return tableSortStep && table && table.pos === tableSortStep.pos ? tableSortStep.next : undefined;
|
|
@@ -117,8 +112,6 @@ var buildPluginState = function buildPluginState(builders) {
|
|
|
117
112
|
targetCellPosition: undefined
|
|
118
113
|
}) : pluginState;
|
|
119
114
|
}
|
|
120
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
121
|
-
|
|
122
115
|
return builders.reduce(function (_pluginState, transform) {
|
|
123
116
|
return transform(props)(_pluginState);
|
|
124
117
|
}, pluginState);
|
|
@@ -93,14 +93,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
93
93
|
state: state,
|
|
94
94
|
key: _pluginKey.pluginKey,
|
|
95
95
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
96
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
97
|
-
|
|
98
96
|
var tr = transactions.find(function (tr) {
|
|
99
97
|
return tr.getMeta('uiEvent') === 'cut';
|
|
100
98
|
});
|
|
101
99
|
function reportInvalidTableCellSpanAttrs(invalidNodeAttr) {
|
|
102
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
103
|
-
|
|
104
100
|
if (invalidTableIds.find(function (id) {
|
|
105
101
|
return id === invalidNodeAttr.tableLocalId;
|
|
106
102
|
})) {
|
|
@@ -127,8 +123,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
127
123
|
var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState, pluginInjectionApi, editorAnalyticsAPI, editorViewRef || undefined, isTableScalingEnabled, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent);
|
|
128
124
|
return (0, _fixTables.fixTables)(updatedTr) || updatedTr;
|
|
129
125
|
}
|
|
130
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
131
|
-
|
|
132
126
|
if (transactions.find(function (tr) {
|
|
133
127
|
return tr.docChanged;
|
|
134
128
|
})) {
|
|
@@ -200,7 +194,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
200
194
|
};
|
|
201
195
|
},
|
|
202
196
|
props: {
|
|
203
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
204
197
|
transformPasted: function transformPasted(slice) {
|
|
205
198
|
var editorState = getCurrentEditorState();
|
|
206
199
|
if (!editorState) {
|
|
@@ -258,8 +251,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
258
251
|
}
|
|
259
252
|
return slice;
|
|
260
253
|
},
|
|
261
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
262
|
-
|
|
263
254
|
handleClick: function handleClick(_ref2, _pos, event) {
|
|
264
255
|
var state = _ref2.state,
|
|
265
256
|
dispatch = _ref2.dispatch;
|
|
@@ -290,8 +281,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
290
281
|
var maybeTr = (0, _utils.closestElement)(domRef, 'tr');
|
|
291
282
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
292
283
|
},
|
|
293
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
294
|
-
|
|
295
284
|
handleTextInput: function handleTextInput(view, _from, _to, text) {
|
|
296
285
|
var state = view.state,
|
|
297
286
|
dispatch = view.dispatch;
|
|
@@ -312,26 +301,14 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
312
301
|
return false;
|
|
313
302
|
},
|
|
314
303
|
nodeViews: nodeViews,
|
|
315
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
316
|
-
|
|
317
304
|
handleDOMEvents: {
|
|
318
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
319
|
-
|
|
320
305
|
focus: _eventHandlers.handleFocus,
|
|
321
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
322
|
-
|
|
323
306
|
blur: _eventHandlers.handleBlur,
|
|
324
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
325
|
-
|
|
326
307
|
mousedown: (0, _eventHandlers.withCellTracking)(_eventHandlers.handleMouseDown),
|
|
327
308
|
mouseleave: _eventHandlers.handleMouseLeave,
|
|
328
309
|
mousemove: (0, _eventHandlers.whenTableInFocus)((0, _eventHandlers.handleMouseMove)(nodeViewPortalProviderAPI), pluginInjectionApi),
|
|
329
310
|
mouseenter: _eventHandlers.handleMouseEnter,
|
|
330
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
331
|
-
|
|
332
311
|
mouseup: (0, _eventHandlers.whenTableInFocus)(_eventHandlers.handleMouseUp),
|
|
333
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
334
|
-
|
|
335
312
|
click: (0, _eventHandlers.withCellTracking)((0, _eventHandlers.whenTableInFocus)(_eventHandlers.handleClick))
|
|
336
313
|
},
|
|
337
314
|
handleTripleClick: _eventHandlers.handleTripleClick
|
|
@@ -24,8 +24,6 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
24
24
|
decorations: _view.DecorationSet.empty
|
|
25
25
|
};
|
|
26
26
|
},
|
|
27
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
28
|
-
|
|
29
27
|
apply: function apply(tr, value) {
|
|
30
28
|
var renderSpan = tr.getMeta(tableSafariDeleteCompositionTextIssueWorkaroundKey);
|
|
31
29
|
if (typeof renderSpan === 'undefined') {
|
|
@@ -51,17 +49,11 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
51
49
|
}
|
|
52
50
|
},
|
|
53
51
|
props: {
|
|
54
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
55
|
-
|
|
56
52
|
decorations: function decorations(state) {
|
|
57
53
|
var _tableSafariDeleteCom;
|
|
58
54
|
return (_tableSafariDeleteCom = tableSafariDeleteCompositionTextIssueWorkaroundKey.getState(state)) === null || _tableSafariDeleteCom === void 0 ? void 0 : _tableSafariDeleteCom.decorations;
|
|
59
55
|
},
|
|
60
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
61
|
-
|
|
62
56
|
handleDOMEvents: {
|
|
63
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
64
|
-
|
|
65
57
|
beforeinput: function beforeinput(view, event) {
|
|
66
58
|
if ((event === null || event === void 0 ? void 0 : event.inputType) !== 'deleteCompositionText') {
|
|
67
59
|
return false;
|
|
@@ -22,13 +22,11 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
22
22
|
return new _safePlugin.SafePlugin({
|
|
23
23
|
key: pluginKey,
|
|
24
24
|
state: {
|
|
25
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
26
25
|
init: function init() {
|
|
27
26
|
return {
|
|
28
27
|
lastTrigger: undefined
|
|
29
28
|
};
|
|
30
29
|
},
|
|
31
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
32
30
|
apply: function apply(tr, pluginState) {
|
|
33
31
|
var meta = tr.getMeta(META_KEYS.OVERFLOW_TRIGGER);
|
|
34
32
|
var newState = _objectSpread({}, pluginState);
|
|
@@ -40,8 +38,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
40
38
|
return pluginState;
|
|
41
39
|
}
|
|
42
40
|
},
|
|
43
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
44
|
-
|
|
45
41
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
46
42
|
var _newPluginState$lastT;
|
|
47
43
|
var newPluginState = pluginKey.getState(newState);
|
|
@@ -53,9 +49,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
53
49
|
// However, since there is still a chance that there are other triggers we didn't think of,
|
|
54
50
|
// all these unknown triggers and viwport width change trigger are captured as EXTERNAL.
|
|
55
51
|
_analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.EXTERNAL;
|
|
56
|
-
|
|
57
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
58
|
-
|
|
59
52
|
transactions.forEach(function (tr) {
|
|
60
53
|
var payload = tr.getMeta(META_KEYS.OVERFLOW_STATE_CHANGED);
|
|
61
54
|
if (payload) {
|
|
@@ -39,19 +39,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
39
39
|
return new _safePlugin.SafePlugin({
|
|
40
40
|
key: pluginKey,
|
|
41
41
|
state: {
|
|
42
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
43
42
|
init: function init() {
|
|
44
43
|
return {
|
|
45
44
|
parsedForLocalIds: false
|
|
46
45
|
};
|
|
47
46
|
},
|
|
48
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
49
47
|
apply: function apply(tr, pluginState) {
|
|
50
48
|
var meta = tr.getMeta(pluginKey);
|
|
51
49
|
if (meta) {
|
|
52
50
|
var keys = Object.keys(meta);
|
|
53
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
54
|
-
|
|
55
51
|
var changed = keys.some(function (key) {
|
|
56
52
|
return pluginState[key] !== meta[key];
|
|
57
53
|
});
|
|
@@ -83,7 +79,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
83
79
|
* add/dedupe the necessary IDs. But general usage of the editor
|
|
84
80
|
* without collab should still solve for IDs.
|
|
85
81
|
*/
|
|
86
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
87
82
|
update: function update(editorView) {
|
|
88
83
|
var state = editorView.state;
|
|
89
84
|
var pluginState = getPluginState(state);
|
|
@@ -98,8 +93,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
98
93
|
(0, _rafSchd.default)(function () {
|
|
99
94
|
var tr = editorView.state.tr;
|
|
100
95
|
var tableIdWasAdded = false;
|
|
101
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
102
|
-
|
|
103
96
|
editorView.state.doc.descendants(function (node, pos) {
|
|
104
97
|
var isTable = node.type === table;
|
|
105
98
|
var localId = node.attrs.localId;
|
|
@@ -127,8 +120,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
127
120
|
}
|
|
128
121
|
};
|
|
129
122
|
},
|
|
130
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
131
|
-
|
|
132
123
|
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
133
124
|
var modified = false;
|
|
134
125
|
var tr = newState.tr;
|
|
@@ -136,9 +127,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
136
127
|
var addedTableNodes = new Set();
|
|
137
128
|
var addedTableNodePos = new Map();
|
|
138
129
|
var localIds = new Set();
|
|
139
|
-
|
|
140
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
141
|
-
|
|
142
130
|
transactions.forEach(function (transaction) {
|
|
143
131
|
if (!transaction.docChanged) {
|
|
144
132
|
return;
|
|
@@ -160,9 +148,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
160
148
|
if (!(0, _utils.stepHasSlice)(step)) {
|
|
161
149
|
continue;
|
|
162
150
|
}
|
|
163
|
-
|
|
164
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
165
|
-
|
|
166
151
|
step.slice.content.descendants(function (node) {
|
|
167
152
|
if (node.type === table) {
|
|
168
153
|
addedTableNodes.add(node);
|
|
@@ -181,8 +166,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
181
166
|
}
|
|
182
167
|
|
|
183
168
|
// Get the existing localIds on the page
|
|
184
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
185
|
-
|
|
186
169
|
newState.doc.descendants(function (node, pos) {
|
|
187
170
|
// Skip if this is position of added table
|
|
188
171
|
if (addedTableNodes.has(node)) {
|
|
@@ -27,17 +27,13 @@ function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureF
|
|
|
27
27
|
lastClick: null
|
|
28
28
|
}),
|
|
29
29
|
props: {
|
|
30
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
31
30
|
attributes: function attributes(state) {
|
|
32
31
|
var pluginState = (0, _pluginFactory2.getPluginState)(state);
|
|
33
32
|
return {
|
|
34
33
|
class: (0, _classnames2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.TableCssClassName.RESIZE_CURSOR, pluginState.resizeHandlePos !== null), _types.TableCssClassName.IS_RESIZING, !!pluginState.dragging))
|
|
35
34
|
};
|
|
36
35
|
},
|
|
37
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
38
|
-
|
|
39
36
|
handleDOMEvents: {
|
|
40
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
41
37
|
mousedown: function mousedown(view, event) {
|
|
42
38
|
var state = view.state;
|
|
43
39
|
var resizeHandlePos =
|
|
@@ -20,14 +20,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
|
20
20
|
isSelectorOpen: false
|
|
21
21
|
};
|
|
22
22
|
},
|
|
23
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
24
|
-
|
|
25
23
|
apply: function apply(tr, currentPluginState) {
|
|
26
24
|
var meta = tr.getMeta(pluginKey);
|
|
27
25
|
if (meta) {
|
|
28
26
|
var keys = Object.keys(meta);
|
|
29
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
30
|
-
|
|
31
27
|
var changed = keys.some(function (key) {
|
|
32
28
|
return currentPluginState[key] !== meta[key];
|
|
33
29
|
});
|
|
@@ -32,19 +32,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, isTabl
|
|
|
32
32
|
return new _safePlugin.SafePlugin({
|
|
33
33
|
key: pluginKey,
|
|
34
34
|
state: {
|
|
35
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
36
35
|
init: function init() {
|
|
37
36
|
return {
|
|
38
37
|
documentHasLoadedOnce: false
|
|
39
38
|
};
|
|
40
39
|
},
|
|
41
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
42
40
|
apply: function apply(tr, pluginState) {
|
|
43
41
|
var meta = tr.getMeta(pluginKey);
|
|
44
42
|
if (meta) {
|
|
45
43
|
var keys = Object.keys(meta);
|
|
46
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
47
|
-
|
|
48
44
|
var changed = keys.some(function (key) {
|
|
49
45
|
return pluginState[key] !== meta[key];
|
|
50
46
|
});
|
|
@@ -59,7 +55,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, isTabl
|
|
|
59
55
|
},
|
|
60
56
|
view: function view() {
|
|
61
57
|
return {
|
|
62
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
63
58
|
update: function update(editorView) {
|
|
64
59
|
var state = editorView.state;
|
|
65
60
|
var pluginState = getPluginState(state);
|
|
@@ -74,8 +69,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, isTabl
|
|
|
74
69
|
(0, _rafSchd.default)(function () {
|
|
75
70
|
var tr = editorView.state.tr;
|
|
76
71
|
var tableWidthAndLayoutUpdated = false;
|
|
77
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
78
|
-
|
|
79
72
|
editorView.state.doc.descendants(function (node, pos) {
|
|
80
73
|
var isTable = node.type === table;
|
|
81
74
|
var width = node.attrs.width;
|
|
@@ -27,7 +27,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
27
27
|
return new _safePlugin.SafePlugin({
|
|
28
28
|
key: pluginKey,
|
|
29
29
|
state: {
|
|
30
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
31
30
|
init: function init() {
|
|
32
31
|
return {
|
|
33
32
|
resizing: false,
|
|
@@ -35,13 +34,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
35
34
|
tableRef: null
|
|
36
35
|
};
|
|
37
36
|
},
|
|
38
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
39
37
|
apply: function apply(tr, pluginState) {
|
|
40
38
|
var meta = tr.getMeta(pluginKey);
|
|
41
39
|
if (meta) {
|
|
42
40
|
var keys = Object.keys(meta);
|
|
43
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
44
|
-
|
|
45
41
|
var changed = keys.some(function (key) {
|
|
46
42
|
return pluginState[key] !== meta[key];
|
|
47
43
|
});
|
|
@@ -54,17 +50,12 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
54
50
|
return pluginState;
|
|
55
51
|
}
|
|
56
52
|
},
|
|
57
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
58
|
-
|
|
59
53
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
60
54
|
// When document first load in Confluence, initially it is an empty document
|
|
61
55
|
// and Collab service triggers a transaction to replace the empty document with the real document that should be rendered.
|
|
62
56
|
// what we need to do is to add width attr to all tables in the real document
|
|
63
57
|
// isReplaceDocumentOperation is checking if the transaction is the one that replace the empty document with the real document
|
|
64
58
|
var isReplaceDocumentOperation = (0, _document.isReplaceDocOperation)(transactions, oldState);
|
|
65
|
-
|
|
66
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
67
|
-
|
|
68
59
|
var referentialityTr = transactions.find(function (tr) {
|
|
69
60
|
return tr.getMeta('referentialityTableInserted');
|
|
70
61
|
});
|
|
@@ -76,8 +67,6 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
76
67
|
var table = newState.schema.nodes.table;
|
|
77
68
|
var tr = newState.tr;
|
|
78
69
|
if (isReplaceDocumentOperation && !isCommentEditor) {
|
|
79
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
80
|
-
|
|
81
70
|
newState.doc.forEach(function (node, offset) {
|
|
82
71
|
if (node.type === table) {
|
|
83
72
|
var width = node.attrs.width;
|
|
@@ -116,14 +105,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
116
105
|
});
|
|
117
106
|
}
|
|
118
107
|
if (referentialityTr) {
|
|
119
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
120
|
-
|
|
121
108
|
referentialityTr.steps.forEach(function (step) {
|
|
122
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
123
|
-
|
|
124
109
|
step.getMap().forEach(function (_, __, newStart, newEnd) {
|
|
125
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
126
|
-
|
|
127
110
|
newState.doc.nodesBetween(newStart, newEnd, function (node, pos) {
|
|
128
111
|
if (node.type === table) {
|
|
129
112
|
if (shouldPatchTableWidth && node.attrs.width !== (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH) {
|