@atlaskit/editor-plugin-table 15.4.9 → 15.4.11

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +27 -23
  3. package/dist/cjs/pm-plugins/analytics/plugin.js +0 -8
  4. package/dist/cjs/pm-plugins/decorations/plugin.js +0 -6
  5. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +0 -9
  6. package/dist/cjs/pm-plugins/handlers.js +1 -8
  7. package/dist/cjs/pm-plugins/main.js +0 -23
  8. package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
  9. package/dist/cjs/pm-plugins/table-analytics.js +0 -7
  10. package/dist/cjs/pm-plugins/table-local-id.js +0 -17
  11. package/dist/cjs/pm-plugins/table-resizing/plugin.js +0 -4
  12. package/dist/cjs/pm-plugins/table-size-selector.js +0 -4
  13. package/dist/cjs/pm-plugins/table-width-in-comment-fix.js +0 -7
  14. package/dist/cjs/pm-plugins/table-width.js +0 -17
  15. package/dist/cjs/pm-plugins/view-mode-sort/index.js +0 -40
  16. package/dist/cjs/tablePlugin.js +0 -2
  17. package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +24 -20
  18. package/dist/es2019/pm-plugins/analytics/plugin.js +0 -8
  19. package/dist/es2019/pm-plugins/decorations/plugin.js +0 -6
  20. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +0 -9
  21. package/dist/es2019/pm-plugins/handlers.js +1 -8
  22. package/dist/es2019/pm-plugins/main.js +0 -24
  23. package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
  24. package/dist/es2019/pm-plugins/table-analytics.js +0 -9
  25. package/dist/es2019/pm-plugins/table-local-id.js +0 -20
  26. package/dist/es2019/pm-plugins/table-resizing/plugin.js +0 -6
  27. package/dist/es2019/pm-plugins/table-size-selector.js +0 -4
  28. package/dist/es2019/pm-plugins/table-width-in-comment-fix.js +0 -10
  29. package/dist/es2019/pm-plugins/table-width.js +0 -19
  30. package/dist/es2019/pm-plugins/view-mode-sort/index.js +0 -42
  31. package/dist/es2019/tablePlugin.js +0 -2
  32. package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +27 -23
  33. package/dist/esm/pm-plugins/analytics/plugin.js +0 -8
  34. package/dist/esm/pm-plugins/decorations/plugin.js +0 -6
  35. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +0 -9
  36. package/dist/esm/pm-plugins/handlers.js +1 -8
  37. package/dist/esm/pm-plugins/main.js +0 -23
  38. package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
  39. package/dist/esm/pm-plugins/table-analytics.js +0 -7
  40. package/dist/esm/pm-plugins/table-local-id.js +0 -17
  41. package/dist/esm/pm-plugins/table-resizing/plugin.js +0 -4
  42. package/dist/esm/pm-plugins/table-size-selector.js +0 -4
  43. package/dist/esm/pm-plugins/table-width-in-comment-fix.js +0 -7
  44. package/dist/esm/pm-plugins/table-width.js +0 -17
  45. package/dist/esm/pm-plugins/view-mode-sort/index.js +0 -40
  46. package/dist/esm/tablePlugin.js +0 -2
  47. package/dist/types/nodeviews/TableRowNativeStickyWithFallback.d.ts +4 -4
  48. package/dist/types-ts4.5/nodeviews/TableRowNativeStickyWithFallback.d.ts +4 -4
  49. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 15.4.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
8
+ tsignores added for help-center local consumpton removed
9
+ - Updated dependencies
10
+
11
+ ## 15.4.10
12
+
13
+ ### Patch Changes
14
+
15
+ - [`5a25eff5f9f2d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5a25eff5f9f2d) -
16
+ [ux] Correctly disable legacy sticky table header when no overflow
17
+ - Updated dependencies
18
+
3
19
  ## 15.4.9
4
20
 
5
21
  ### Patch Changes
@@ -47,7 +47,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
47
47
  _this.nodeVisibilityObserverCleanupFn && _this.nodeVisibilityObserverCleanupFn();
48
48
  var tree = (0, _dom2.getTree)(_this.dom);
49
49
  if (tree) {
50
- _this.makeRowHeaderNotSticky(tree.table, true);
50
+ _this.makeRowHeaderNotLegacySticky(tree.table, true);
51
51
  }
52
52
  _this.emitOff(false);
53
53
  }
@@ -85,13 +85,13 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
85
85
  // This prevents mouse wheel scrolling on the scroll-parent div when user's mouse is hovering the header row.
86
86
  // This fix sets pointer-events: none on the header row briefly to avoid this behaviour
87
87
  (0, _defineProperty2.default)(_this, "headerRowMouseScroll", (0, _throttle.default)(function () {
88
- if (_this.isSticky) {
88
+ if (_this.isLegacySticky) {
89
89
  _this.dom.classList.add('no-pointer-events');
90
90
  _this.headerRowMouseScrollEnd();
91
91
  }
92
92
  }, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT));
93
93
  _this.isHeaderRow = (0, _nodes.supportedHeaderRow)(node);
94
- _this.isSticky = false;
94
+ _this.isLegacySticky = false;
95
95
  var _getPluginState = (0, _pluginFactory.getPluginState)(view.state),
96
96
  pluginConfig = _getPluginState.pluginConfig;
97
97
  _this.isStickyHeaderEnabled = !!pluginConfig.stickyHeaders;
@@ -181,7 +181,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
181
181
  this.nodeVisibilityObserverCleanupFn && this.nodeVisibilityObserverCleanupFn();
182
182
  var tree = (0, _dom2.getTree)(this.dom);
183
183
  if (tree) {
184
- this.makeRowHeaderNotSticky(tree.table, true);
184
+ this.makeRowHeaderNotLegacySticky(tree.table, true);
185
185
  }
186
186
  this.emitOff(true);
187
187
  }
@@ -303,8 +303,8 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
303
303
  observer.root.classList.remove(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW);
304
304
  _this2.dom.classList.remove(_types.TableCssClassName.NATIVE_STICKY);
305
305
  _this2.isNativeSticky = false;
306
- _this2.refreshStickyState();
307
306
  }
307
+ _this2.refreshLegacyStickyState();
308
308
  });
309
309
  }, options);
310
310
  }
@@ -516,29 +516,33 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
516
516
  // Keep the other sentinels rootBounds in sync with this latest one
517
517
  _this6.sentinelData[targetKey === 'top' ? 'bottom' : targetKey].rootBounds = rootBounds !== null && rootBounds !== void 0 ? rootBounds : entry.rootBounds;
518
518
  });
519
- _this6.refreshStickyState();
519
+ _this6.refreshLegacyStickyState();
520
520
  }, {
521
521
  threshold: 0,
522
522
  root: this.editorScrollableElement
523
523
  });
524
524
  }
525
525
  }, {
526
- key: "refreshStickyState",
527
- value: function refreshStickyState() {
526
+ key: "refreshLegacyStickyState",
527
+ value: function refreshLegacyStickyState() {
528
528
  var tree = (0, _dom2.getTree)(this.dom);
529
529
  if (!tree) {
530
530
  return;
531
531
  }
532
532
  var table = tree.table;
533
+ if (this.isNativeSticky) {
534
+ this.makeRowHeaderNotLegacySticky(table);
535
+ return;
536
+ }
533
537
  var shouldStick = this.shouldSticky();
534
- if (this.isSticky !== shouldStick) {
535
- if (shouldStick && !this.isNativeSticky) {
538
+ if (this.isLegacySticky !== shouldStick) {
539
+ if (shouldStick) {
536
540
  var _this$sentinelData$to;
537
541
  // The rootRect is kept in sync across sentinels so it doesn't matter which one we use.
538
542
  var rootRect = (_this$sentinelData$to = this.sentinelData.top.rootBounds) !== null && _this$sentinelData$to !== void 0 ? _this$sentinelData$to : this.sentinelData.bottom.rootBounds;
539
- this.makeHeaderRowSticky(tree, rootRect === null || rootRect === void 0 ? void 0 : rootRect.top);
543
+ this.makeHeaderRowLegacySticky(tree, rootRect === null || rootRect === void 0 ? void 0 : rootRect.top);
540
544
  } else {
541
- this.makeRowHeaderNotSticky(table);
545
+ this.makeRowHeaderNotLegacySticky(table);
542
546
  }
543
547
  }
544
548
  }
@@ -639,7 +643,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
639
643
 
640
644
  // If current table selected and header row is toggled off, turn off sticky header
641
645
  if (isCurrentTableSelected && !state.isHeaderRowEnabled && tree) {
642
- this.makeRowHeaderNotSticky(tree.table);
646
+ this.makeRowHeaderNotLegacySticky(tree.table);
643
647
  }
644
648
  this.focused = isCurrentTableSelected;
645
649
  var wrapper = tree.wrapper;
@@ -688,7 +692,7 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
688
692
  key: "refireIntersectionObservers",
689
693
  value: function refireIntersectionObservers() {
690
694
  var _this7 = this;
691
- if (this.isSticky) {
695
+ if (this.isLegacySticky) {
692
696
  [this.sentinels.top, this.sentinels.bottom].forEach(function (el) {
693
697
  if (el && _this7.intersectionObserver) {
694
698
  _this7.intersectionObserver.unobserve(el);
@@ -698,12 +702,12 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
698
702
  }
699
703
  }
700
704
  }, {
701
- key: "makeHeaderRowSticky",
702
- value: function makeHeaderRowSticky(tree, scrollTop) {
705
+ key: "makeHeaderRowLegacySticky",
706
+ value: function makeHeaderRowLegacySticky(tree, scrollTop) {
703
707
  var _tbody$firstChild,
704
708
  _this8 = this;
705
709
  // If header row height is more than 50% of viewport height don't do this
706
- if (this.isSticky || this.stickyRowHeight && this.stickyRowHeight > window.innerHeight / 2 || this.isInNestedTable) {
710
+ if (this.isLegacySticky || this.stickyRowHeight && this.stickyRowHeight > window.innerHeight / 2 || this.isInNestedTable) {
707
711
  return;
708
712
  }
709
713
  var table = tree.table,
@@ -720,12 +724,12 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
720
724
  scrollTop = (0, _dom2.getTop)(this.editorScrollableElement);
721
725
  }
722
726
  var domTop = currentTableTop > 0 ? scrollTop : scrollTop + currentTableTop;
723
- if (!this.isSticky) {
727
+ if (!this.isLegacySticky) {
724
728
  var _this$editorScrollabl;
725
729
  (0, _dom.syncStickyRowToTable)(table);
726
730
  this.dom.classList.add('sticky');
727
731
  table.classList.add(_types.TableCssClassName.TABLE_STICKY);
728
- this.isSticky = true;
732
+ this.isLegacySticky = true;
729
733
 
730
734
  /**
731
735
  * The logic below is not desirable, but acts as a fail safe for scenarios where the sticky header
@@ -749,16 +753,16 @@ var TableRowNativeStickyWithFallback = exports.default = /*#__PURE__*/function (
749
753
  this.emitOn(domTop, this.colControlsOffset);
750
754
  }
751
755
  }, {
752
- key: "makeRowHeaderNotSticky",
753
- value: function makeRowHeaderNotSticky(table) {
756
+ key: "makeRowHeaderNotLegacySticky",
757
+ value: function makeRowHeaderNotLegacySticky(table) {
754
758
  var isEditorDestroyed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
755
- if (!this.isSticky || !table || !this.dom) {
759
+ if (!this.isLegacySticky || !table || !this.dom) {
756
760
  return;
757
761
  }
758
762
  this.dom.style.removeProperty('width');
759
763
  this.dom.classList.remove('sticky');
760
764
  table.classList.remove(_types.TableCssClassName.TABLE_STICKY);
761
- this.isSticky = false;
765
+ this.isLegacySticky = false;
762
766
  this.dom.style.top = '';
763
767
  table.style.removeProperty('margin-top');
764
768
  this.emitOff(isEditorDestroyed);
@@ -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
- // @ts-ignore - Workaround for help-center local consumption
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) {