@atlaskit/editor-plugin-table 19.0.1 → 20.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/nodeviews/table.js +18 -2
  3. package/dist/cjs/nodeviews/toDOM.js +18 -4
  4. package/dist/cjs/pm-plugins/main.js +38 -4
  5. package/dist/cjs/pm-plugins/table-width.js +10 -0
  6. package/dist/cjs/pm-plugins/transforms/content-mode.js +48 -0
  7. package/dist/cjs/pm-plugins/transforms/fix-tables.js +4 -35
  8. package/dist/cjs/pm-plugins/transforms/table-transform-utils.js +62 -0
  9. package/dist/cjs/pm-plugins/utils/tableMode.js +149 -0
  10. package/dist/cjs/ui/event-handlers.js +3 -2
  11. package/dist/cjs/ui/toolbar.js +25 -2
  12. package/dist/es2019/nodeviews/table.js +18 -2
  13. package/dist/es2019/nodeviews/toDOM.js +18 -4
  14. package/dist/es2019/pm-plugins/main.js +38 -4
  15. package/dist/es2019/pm-plugins/table-width.js +10 -0
  16. package/dist/es2019/pm-plugins/transforms/content-mode.js +39 -0
  17. package/dist/es2019/pm-plugins/transforms/fix-tables.js +2 -33
  18. package/dist/es2019/pm-plugins/transforms/table-transform-utils.js +56 -0
  19. package/dist/es2019/pm-plugins/utils/tableMode.js +148 -0
  20. package/dist/es2019/ui/event-handlers.js +4 -3
  21. package/dist/es2019/ui/toolbar.js +23 -2
  22. package/dist/esm/nodeviews/table.js +18 -2
  23. package/dist/esm/nodeviews/toDOM.js +18 -4
  24. package/dist/esm/pm-plugins/main.js +38 -4
  25. package/dist/esm/pm-plugins/table-width.js +10 -0
  26. package/dist/esm/pm-plugins/transforms/content-mode.js +41 -0
  27. package/dist/esm/pm-plugins/transforms/fix-tables.js +2 -33
  28. package/dist/esm/pm-plugins/transforms/table-transform-utils.js +56 -0
  29. package/dist/esm/pm-plugins/utils/tableMode.js +143 -0
  30. package/dist/esm/ui/event-handlers.js +4 -3
  31. package/dist/esm/ui/toolbar.js +25 -2
  32. package/dist/types/pm-plugins/transforms/content-mode.d.ts +8 -0
  33. package/dist/types/pm-plugins/transforms/table-transform-utils.d.ts +11 -0
  34. package/dist/types/pm-plugins/utils/tableMode.d.ts +22 -0
  35. package/dist/types/types/index.d.ts +3 -0
  36. package/dist/types-ts4.5/pm-plugins/transforms/content-mode.d.ts +8 -0
  37. package/dist/types-ts4.5/pm-plugins/transforms/table-transform-utils.d.ts +11 -0
  38. package/dist/types-ts4.5/pm-plugins/utils/tableMode.d.ts +22 -0
  39. package/dist/types-ts4.5/types/index.d.ts +3 -0
  40. package/package.json +21 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 20.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b10c935ca9497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b10c935ca9497) -
8
+ Removed deprecated `browser` singleton from editor-common. This has been replaced with a
9
+ `getBrowserInfo` function that returns the same information. This change was made to avoid issues
10
+ with module loading order and to provide a more consistent API for accessing browser information.
11
+
12
+ Please update any imports of `browser` to use `getBrowserInfo` instead. For example, the following
13
+ imports have been removed:
14
+
15
+ ```javascript
16
+ import { browser } from '@atlaskit/editor-common/utils';
17
+ import { browser } from '@atlaskit/editor-common/browser';
18
+ ```
19
+
20
+ Instead, please use:
21
+
22
+ ```javascript
23
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
24
+ ```
25
+
26
+ If you were previously using `browser.ie_version`, you would now use
27
+ `getBrowserInfo().ie_version`.
28
+
29
+ - Updated dependencies
30
+
3
31
  ## 19.0.1
4
32
 
5
33
  ### Patch Changes
@@ -22,10 +22,12 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
22
  var _tableMap = require("@atlaskit/editor-tables/table-map");
23
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
25
26
  var _createPluginConfig = require("../pm-plugins/create-plugin-config");
26
27
  var _pluginFactory = require("../pm-plugins/plugin-factory");
27
28
  var _tableWidth = require("../pm-plugins/table-width");
28
29
  var _nodes = require("../pm-plugins/utils/nodes");
30
+ var _tableMode = require("../pm-plugins/utils/tableMode");
29
31
  var _TableComponentWithSharedState = require("./TableComponentWithSharedState");
30
32
  var _toDOM = require("./toDOM");
31
33
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -205,7 +207,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
205
207
  key: "setDomAttrs",
206
208
  value: function setDomAttrs(node) {
207
209
  var _this3 = this,
208
- _this$reactComponentP6,
210
+ _this$reactComponentP8,
209
211
  _this$getEditorFeatur2,
210
212
  _this$options3,
211
213
  _this$options4;
@@ -213,12 +215,26 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
213
215
  return; // width / attribute application to actual table will happen later when table is set
214
216
  }
215
217
  var attrs = tableAttributes(node);
218
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
219
+ var _this$reactComponentP6, _this$reactComponentP7;
220
+ if ((0, _tableMode.isTableInContentMode)({
221
+ node: node,
222
+ allowColumnResizing: !!this.reactComponentProps.allowColumnResizing,
223
+ allowTableResizing: !!this.reactComponentProps.allowTableResizing,
224
+ isFullPageEditor: !((_this$reactComponentP6 = this.reactComponentProps.options) !== null && _this$reactComponentP6 !== void 0 && _this$reactComponentP6.isCommentEditor) && !((_this$reactComponentP7 = this.reactComponentProps.options) !== null && _this$reactComponentP7 !== void 0 && _this$reactComponentP7.isChromelessEditor),
225
+ isTableNested: (0, _nodes.isTableNested)(this.view.state, this.getPos())
226
+ }) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
227
+ attrs['data-initial-width-mode'] = 'content';
228
+ } else {
229
+ this.table.removeAttribute('data-initial-width-mode');
230
+ }
231
+ }
216
232
  Object.keys(attrs).forEach(function (attr) {
217
233
  // Ignored via go/ees005
218
234
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
219
235
  _this3.table.setAttribute(attr, attrs[attr]);
220
236
  });
221
- var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? (_this$reactComponentP6 = this.reactComponentProps) === null || _this$reactComponentP6 === void 0 ? void 0 : _this$reactComponentP6.allowFixedColumnWidthOption : (_this$getEditorFeatur2 = this.getEditorFeatureFlags) === null || _this$getEditorFeatur2 === void 0 ? void 0 : _this$getEditorFeatur2.call(this).tableWithFixedColumnWidthsOption) || false;
237
+ var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? (_this$reactComponentP8 = this.reactComponentProps) === null || _this$reactComponentP8 === void 0 ? void 0 : _this$reactComponentP8.allowFixedColumnWidthOption : (_this$getEditorFeatur2 = this.getEditorFeatureFlags) === null || _this$getEditorFeatur2 === void 0 ? void 0 : _this$getEditorFeatur2.call(this).tableWithFixedColumnWidthsOption) || false;
222
238
  // Preserve Table Width cannot have inline width set on the table
223
239
  if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && node.attrs.displayMode === 'fixed') {
224
240
  var _tableWidthPluginKey$;
@@ -8,6 +8,7 @@ exports.tableNodeSpecWithFixedToDOM = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _classnames = _interopRequireDefault(require("classnames"));
11
12
  var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
12
13
  var _adfSchema = require("@atlaskit/adf-schema");
13
14
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
@@ -15,6 +16,7 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
16
17
  var _consts = require("../pm-plugins/table-resizing/utils/consts");
17
18
  var _misc = require("../pm-plugins/table-resizing/utils/misc");
19
+ var _tableMode = require("../pm-plugins/utils/tableMode");
18
20
  var _tableContainerStyles = require("./table-container-styles");
19
21
  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; }
20
22
  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; }
@@ -22,6 +24,14 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
22
24
  var tableNode = config.isNestingSupported ? _adfSchema.tableWithNestedTable : _adfSchema.table;
23
25
  return _objectSpread(_objectSpread({}, tableNode), {}, {
24
26
  toDOM: function toDOM(node) {
27
+ var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
28
+ var isInContentMode = (0, _tableMode.isTableInContentMode)({
29
+ node: node,
30
+ allowColumnResizing: config.allowColumnResizing,
31
+ allowTableResizing: config.tableResizingEnabled,
32
+ isFullPageEditor: isFullPageEditor,
33
+ isTableNested: config.isNested
34
+ }) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true);
25
35
  var alignmentStyle = Object.entries((0, _tableContainerStyles.getAlignmentStyle)(node.attrs.layout)).map(function (_ref) {
26
36
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
27
37
  k = _ref2[0],
@@ -29,7 +39,6 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
29
39
  return "".concat((0, _kebabCase.default)(k), ": ").concat((0, _kebabCase.default)(v));
30
40
  }).join(';');
31
41
  var tableMinWidth = (0, _colgroup.getResizerMinWidth)(node);
32
- var isFullPageEditor = !config.isChromelessEditor && !config.isCommentEditor;
33
42
  var attrs = {
34
43
  'data-number-column': node.attrs.isNumberColumnEnabled,
35
44
  'data-layout': node.attrs.layout,
@@ -39,6 +48,9 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
39
48
  'data-ssr-placeholder': "table-".concat(node.attrs.localId),
40
49
  'data-ssr-placeholder-replace': "table-".concat(node.attrs.localId)
41
50
  };
51
+ if (isInContentMode) {
52
+ attrs['data-initial-width-mode'] = 'content';
53
+ }
42
54
  if ((0, _expValEquals.expValEquals)('platform_editor_table_display_mode_in_to_dom', 'isEnabled', true)) {
43
55
  attrs['data-table-display-mode'] = node.attrs.displayMode;
44
56
  }
@@ -91,11 +103,13 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
91
103
  class: 'pm-table-resizer-container',
92
104
  style: (0, _lazyNodeView.convertToInlineCss)({
93
105
  '--ak-editor-table-gutter-padding': config.isTableScalingEnabled ? 'calc(var(--ak-editor--large-gutter-padding) * 2)' : 'calc(var(--ak-editor--large-gutter-padding) * 2 - var(--ak-editor-resizer-handle-spacing))',
94
- '--ak-editor-table-width': resizableTableWidth,
106
+ '--ak-editor-table-width': isInContentMode ? 'max-content' : resizableTableWidth,
95
107
  width: "var(--ak-editor-table-width)"
96
108
  })
97
109
  }, ['div', {
98
- class: 'resizer-item display-handle',
110
+ class: (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) ? 'resizer-item display-handle' : (0, _classnames.default)('resizer-item', {
111
+ 'display-handle': !isInContentMode
112
+ }),
99
113
  style: (0, _lazyNodeView.convertToInlineCss)({
100
114
  position: 'relative',
101
115
  userSelect: 'auto',
@@ -104,7 +118,7 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
104
118
  '--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
105
119
  minWidth: 'var(--ak-editor-table-min-width)',
106
120
  maxWidth: (0, _misc.getTableResizerContainerMaxWidthInCSS)(config.isCommentEditor, config.isChromelessEditor, config.isTableScalingEnabled),
107
- width: (0, _misc.getTableResizerItemWidthInCSS)(node, config.isCommentEditor, config.isChromelessEditor)
121
+ width: isInContentMode ? 'auto' : (0, _misc.getTableResizerItemWidthInCSS)(node, config.isCommentEditor, config.isChromelessEditor)
108
122
  })
109
123
  }, ['span', {
110
124
  class: 'resizer-hover-zone'
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.createPlugin = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _bindEventListener = require("bind-event-listener");
9
10
  var _analytics = require("@atlaskit/editor-common/analytics");
10
11
  var _browser = require("@atlaskit/editor-common/browser");
11
12
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
@@ -32,12 +33,15 @@ var _fixTables = require("./transforms/fix-tables");
32
33
  var _replaceTable = require("./transforms/replace-table");
33
34
  var _decoration = require("./utils/decoration");
34
35
  var _paste = require("./utils/paste");
36
+ var _tableMode = require("./utils/tableMode");
35
37
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
38
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
39
  var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
38
40
  var _accessibilityUtils;
39
41
  var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
40
42
  pluginConfig: pluginConfig,
43
+ isCommentEditor: isCommentEditor,
44
+ isChromelessEditor: isChromelessEditor,
41
45
  isTableHovered: false,
42
46
  insertColumnButtonIndex: undefined,
43
47
  insertRowButtonIndex: undefined,
@@ -132,8 +136,34 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
132
136
  }
133
137
  },
134
138
  view: function view(editorView) {
139
+ var _pluginInjectionApi$e;
135
140
  var domAtPos = editorView.domAtPos.bind(editorView);
136
141
  editorViewRef = editorView;
142
+ var contentModeSizeTableId = null;
143
+ var focusListenerBinding = null;
144
+ if ((pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) !== 'view' && (0, _tableMode.isContentModeSupported)({
145
+ allowColumnResizing: !!pluginConfig.allowColumnResizing,
146
+ allowTableResizing: !!pluginConfig.allowTableResizing,
147
+ isFullPageEditor: !isChromelessEditor && !isCommentEditor
148
+ }) && (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
149
+ focusListenerBinding = (0, _bindEventListener.bind)(editorView.dom, {
150
+ type: 'focus',
151
+ listener: function listener() {
152
+ if (contentModeSizeTableId) {
153
+ return;
154
+ }
155
+ contentModeSizeTableId = requestAnimationFrame(function () {
156
+ if (!editorViewRef) {
157
+ return;
158
+ }
159
+ (0, _tableMode.applyMeasuredWidthToAllTables)(editorViewRef, pluginInjectionApi);
160
+ });
161
+ },
162
+ options: {
163
+ once: true
164
+ }
165
+ });
166
+ }
137
167
  return {
138
168
  update: function update(view, prevState) {
139
169
  var state = view.state,
@@ -142,12 +172,12 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
142
172
  var pluginState = (0, _pluginFactory.getPluginState)(state);
143
173
  var tableRef;
144
174
  if ((0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd')) {
145
- var _pluginInjectionApi$e;
175
+ var _pluginInjectionApi$e2;
146
176
  var parent = (0, _utils2.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
147
- var shouldSetTableRef = (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) !== 'view' : parent;
177
+ var shouldSetTableRef = (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' : parent;
148
178
  if ((0, _expValEquals.expValEquals)('platform_editor_table_update_table_ref', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_update_table_ref_fix')) {
149
- var _pluginInjectionApi$e2, _pluginInjectionApi$i;
150
- shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 || (_pluginInjectionApi$i = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.interactionState) !== 'hasNotHadInteraction';
179
+ var _pluginInjectionApi$e3, _pluginInjectionApi$i;
180
+ shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e3 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e3 === void 0 || (_pluginInjectionApi$e3 = _pluginInjectionApi$e3.sharedState.currentState()) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : _pluginInjectionApi$e3.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 || (_pluginInjectionApi$i = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.interactionState) !== 'hasNotHadInteraction';
151
181
  }
152
182
  if (shouldSetTableRef) {
153
183
  tableRef =
@@ -209,6 +239,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
209
239
  } else if (pluginState.isResizeHandleWidgetAdded) {
210
240
  (0, _misc.removeResizeHandleDecorations)()(state, dispatch);
211
241
  }
242
+ },
243
+ destroy: function destroy() {
244
+ contentModeSizeTableId && cancelAnimationFrame(contentModeSizeTableId);
245
+ focusListenerBinding && focusListenerBinding();
212
246
  }
213
247
  };
214
248
  },
@@ -15,6 +15,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
15
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
16
  var _consts = require("./table-resizing/utils/consts");
17
17
  var _alignment = require("./utils/alignment");
18
+ var _tableMode = require("./utils/tableMode");
18
19
  var _excluded = ["width"];
19
20
  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; }
20
21
  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; } /**
@@ -68,6 +69,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
68
69
  var tr = newState.tr;
69
70
  if (isReplaceDocumentOperation && !isCommentEditor) {
70
71
  newState.doc.forEach(function (node, offset) {
72
+ if ((0, _tableMode.isTableInContentMode)({
73
+ node: node,
74
+ allowColumnResizing: true,
75
+ allowTableResizing: true,
76
+ isFullPageEditor: true,
77
+ isTableNested: false
78
+ })) {
79
+ return;
80
+ }
71
81
  if (node.type === table) {
72
82
  var width = node.attrs.width;
73
83
  var layout = node.attrs.layout;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getTableMeasurement = exports.applyTableMeasurement = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _styles = require("@atlaskit/editor-common/styles");
10
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
+ var _tableTransformUtils = require("./table-transform-utils");
13
+ 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; }
14
+ 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; }
15
+ var tableWidth = function tableWidth(contentWidth) {
16
+ var maxEditorWidth = (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _editorSharedStyles.akEditorMaxLayoutWidth : _editorSharedStyles.akEditorFullWidthLayoutWidth;
17
+ return Math.min(maxEditorWidth, contentWidth);
18
+ };
19
+ var getTableMeasurement = exports.getTableMeasurement = function getTableMeasurement(tableRef) {
20
+ var colWidths = getRenderedColgroupColumnWidths(tableRef);
21
+ var totalContentWidth = colWidths.reduce(function (acc, current) {
22
+ return acc + current;
23
+ }, 0);
24
+ return {
25
+ colWidths: colWidths,
26
+ tableWidth: tableWidth(totalContentWidth)
27
+ };
28
+ };
29
+ var applyTableMeasurement = exports.applyTableMeasurement = function applyTableMeasurement(tr, tableNode, _ref, tablePos) {
30
+ var colWidths = _ref.colWidths,
31
+ tableWidth = _ref.tableWidth;
32
+ tr = (0, _tableTransformUtils.updateCellsMarkup)(tr, tableNode, tablePos, function (cell, _rowIndex, colIndex) {
33
+ var newColWidths = colWidths.slice(colIndex, colIndex + cell.attrs.colspan);
34
+ return cell.type.createChecked(_objectSpread(_objectSpread({}, cell.attrs), {}, {
35
+ colwidth: newColWidths.length ? newColWidths : null
36
+ }), cell.content, cell.marks);
37
+ });
38
+ return tr.setNodeMarkup(tablePos, undefined, _objectSpread(_objectSpread({}, tableNode.attrs), {}, {
39
+ width: tableWidth
40
+ }));
41
+ };
42
+ function getRenderedColgroupColumnWidths(tableRef) {
43
+ var cols = Array.from(tableRef.querySelectorAll(':scope > colgroup > col'));
44
+ return cols.map(function (col) {
45
+ var width = col.getBoundingClientRect().width;
46
+ return Math.max(Math.round(width), _styles.tableCellMinWidth);
47
+ });
48
+ }
@@ -11,6 +11,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
11
  var _columnState = require("../table-resizing/utils/column-state");
12
12
  var _contentWidth = require("../table-resizing/utils/content-width");
13
13
  var _misc = require("../table-resizing/utils/misc");
14
+ var _tableTransformUtils = require("./table-transform-utils");
14
15
  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; }
15
16
  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; }
16
17
  var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, reportInvalidTableCellSpanAttrs) {
@@ -47,7 +48,7 @@ var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, repor
47
48
  // We remove the third width here, assumed duplicate content.
48
49
  var removeExtraneousColumnWidths = exports.removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs) {
49
50
  var hasProblems = false;
50
- tr = replaceCells(tr, node, basePos, function (cell) {
51
+ tr = (0, _tableTransformUtils.replaceCells)(tr, node, basePos, function (cell) {
51
52
  var _cell$attrs = cell.attrs,
52
53
  colwidth = _cell$attrs.colwidth,
53
54
  colspan = _cell$attrs.colspan,
@@ -117,7 +118,7 @@ var fixAutoSizedTable = exports.fixAutoSizedTable = function fixAutoSizedTable(v
117
118
  var scaledColumnWidths = colWidths.map(function (width) {
118
119
  return Math.floor(width * scale);
119
120
  });
120
- tr = replaceCells(tr, tableNode, tablePos, function (cell, _rowIndex, colIndex) {
121
+ tr = (0, _tableTransformUtils.replaceCells)(tr, tableNode, tablePos, function (cell, _rowIndex, colIndex) {
121
122
  var newColWidths = scaledColumnWidths.slice(colIndex, colIndex + cell.attrs.colspan);
122
123
  return cell.type.createChecked(_objectSpread(_objectSpread({}, cell.attrs), {}, {
123
124
  colwidth: newColWidths.length ? newColWidths : null
@@ -160,36 +161,4 @@ function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
160
161
  }
161
162
  }
162
163
  return cols;
163
- }
164
-
165
- // TODO: ED-26961 - move to prosemirror-utils
166
- var replaceCells = function replaceCells(tr, table, tablePos, modifyCell) {
167
- var rows = [];
168
- var modifiedCells = 0;
169
- for (var rowIndex = 0; rowIndex < table.childCount; rowIndex++) {
170
- var row = table.child(rowIndex);
171
- var cells = [];
172
- for (var colIndex = 0; colIndex < row.childCount; colIndex++) {
173
- var cell = row.child(colIndex);
174
-
175
- // TODO: ED-26961 - The rowIndex and colIndex are not accurate in a merged cell scenario
176
- // e.g. table with 5 columns might have only one cell in a row, colIndex will be 1, where it should be 4
177
- var node = modifyCell(cell, rowIndex, colIndex);
178
- if (node.sameMarkup(cell) === false) {
179
- modifiedCells++;
180
- }
181
- cells.push(node);
182
- }
183
- if (cells.length) {
184
- rows.push(row.type.createChecked(row.attrs, cells, row.marks));
185
- }
186
- }
187
-
188
- // Check if the table has changed before replacing.
189
- // If no cells are modified our counter will be zero.
190
- if (rows.length && modifiedCells !== 0) {
191
- var newTable = table.type.createChecked(table.attrs, rows, table.marks);
192
- return tr.replaceWith(tablePos, tablePos + table.nodeSize, newTable);
193
- }
194
- return tr;
195
- };
164
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updateCellsMarkup = exports.replaceCells = void 0;
7
+ // TODO: ED-26961 - move to prosemirror-utils
8
+ var replaceCells = exports.replaceCells = function replaceCells(tr, table, tablePos, modifyCell) {
9
+ var rows = [];
10
+ var modifiedCells = 0;
11
+ for (var rowIndex = 0; rowIndex < table.childCount; rowIndex++) {
12
+ var row = table.child(rowIndex);
13
+ var cells = [];
14
+ for (var colIndex = 0; colIndex < row.childCount; colIndex++) {
15
+ var cell = row.child(colIndex);
16
+
17
+ // TODO: ED-26961 - The rowIndex and colIndex are not accurate in a merged cell scenario
18
+ // e.g. table with 5 columns might have only one cell in a row, colIndex will be 1, where it should be 4
19
+ var node = modifyCell(cell, rowIndex, colIndex);
20
+ if (node.sameMarkup(cell) === false) {
21
+ modifiedCells++;
22
+ }
23
+ cells.push(node);
24
+ }
25
+ if (cells.length) {
26
+ rows.push(row.type.createChecked(row.attrs, cells, row.marks));
27
+ }
28
+ }
29
+
30
+ // Check if the table has changed before replacing.
31
+ // If no cells are modified our counter will be zero.
32
+ if (rows.length && modifiedCells !== 0) {
33
+ var newTable = table.type.createChecked(table.attrs, rows, table.marks);
34
+ return tr.replaceWith(tablePos, tablePos + table.nodeSize, newTable);
35
+ }
36
+ return tr;
37
+ };
38
+
39
+ /**
40
+ * Position-preserving alternative to `replaceCells`.
41
+ *
42
+ * Uses `setNodeMarkup` per cell instead of rebuilding the whole table with
43
+ * `replaceWith`, so document positions inside cells are never invalidated.
44
+ * This preserves any existing selection through `tr.mapping`.
45
+ */
46
+ var updateCellsMarkup = exports.updateCellsMarkup = function updateCellsMarkup(tr, table, tablePos, modifyCell) {
47
+ var rowOffset = tablePos + 1;
48
+ for (var rowIndex = 0; rowIndex < table.childCount; rowIndex++) {
49
+ var row = table.child(rowIndex);
50
+ var cellOffset = rowOffset + 1;
51
+ for (var colIndex = 0; colIndex < row.childCount; colIndex++) {
52
+ var cell = row.child(colIndex);
53
+ var modified = modifyCell(cell, rowIndex, colIndex);
54
+ if (!modified.sameMarkup(cell)) {
55
+ tr.setNodeMarkup(cellOffset, modified.type, modified.attrs, modified.marks);
56
+ }
57
+ cellOffset += cell.nodeSize;
58
+ }
59
+ rowOffset += row.nodeSize;
60
+ }
61
+ return tr;
62
+ };
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isTableInContentMode = exports.isContentModeSupported = exports.hasTableBeenResized = exports.applyMeasuredWidthToSelectedTable = exports.applyMeasuredWidthToAllTables = void 0;
7
+ var _analytics = require("@atlaskit/editor-common/analytics");
8
+ var _styles = require("@atlaskit/editor-common/styles");
9
+ var _utils = require("@atlaskit/editor-tables/utils");
10
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
11
+ var _colgroup = require("../table-resizing/utils/colgroup");
12
+ var _contentMode = require("../transforms/content-mode");
13
+ var _alignment = require("./alignment");
14
+ var isTableInContentMode = exports.isTableInContentMode = function isTableInContentMode(_ref) {
15
+ var allowColumnResizing = _ref.allowColumnResizing,
16
+ allowTableResizing = _ref.allowTableResizing,
17
+ isFullPageEditor = _ref.isFullPageEditor,
18
+ isTableNested = _ref.isTableNested,
19
+ node = _ref.node;
20
+ if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
21
+ return false;
22
+ }
23
+ if (!node || isTableNested) {
24
+ return false;
25
+ }
26
+ return isContentModeSupported({
27
+ allowColumnResizing: allowColumnResizing,
28
+ allowTableResizing: allowTableResizing,
29
+ isFullPageEditor: isFullPageEditor
30
+ }) && !hasTableBeenResized(node) && node.attrs.layout === _alignment.ALIGN_START;
31
+ };
32
+ var isContentModeSupported = exports.isContentModeSupported = function isContentModeSupported(_ref2) {
33
+ var allowColumnResizing = _ref2.allowColumnResizing,
34
+ allowTableResizing = _ref2.allowTableResizing,
35
+ isFullPageEditor = _ref2.isFullPageEditor;
36
+ return allowColumnResizing && allowTableResizing && isFullPageEditor;
37
+ };
38
+ var hasTableBeenResized = exports.hasTableBeenResized = function hasTableBeenResized(node) {
39
+ return node.attrs.width !== null || (0, _colgroup.hasTableColumnBeenResized)(node);
40
+ };
41
+
42
+ /**
43
+ * Iterates all top-level tables in the document, and for those in content mode,
44
+ * measures rendered column widths and sets colwidth + table width attributes
45
+ * in a single batched transaction.
46
+ */
47
+ var applyMeasuredWidthToAllTables = exports.applyMeasuredWidthToAllTables = function applyMeasuredWidthToAllTables(view, pluginInjectionApi) {
48
+ var _view$state = view.state,
49
+ doc = _view$state.doc,
50
+ schema = _view$state.schema;
51
+ var tr = view.state.tr;
52
+ var table = schema.nodes.table;
53
+ var modified = false;
54
+ var measuredTables = [];
55
+
56
+ // modify only top-level tables
57
+ doc.forEach(function (node, offset) {
58
+ if (node.type !== table || hasTableBeenResized(node) && node.attrs.layout !== _alignment.ALIGN_START) {
59
+ return;
60
+ }
61
+ var domNode = view.domAtPos(offset + 1).node;
62
+ var tableWrapper = domNode instanceof HTMLElement ? domNode.closest(".".concat(_styles.TableSharedCssClassName.TABLE_VIEW_CONTENT_WRAP)) : null;
63
+ var tableRef = tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.querySelector('table');
64
+ if (!tableRef) {
65
+ return;
66
+ }
67
+ measuredTables.push({
68
+ node: node,
69
+ offset: offset,
70
+ measurement: (0, _contentMode.getTableMeasurement)(tableRef)
71
+ });
72
+ });
73
+ measuredTables.forEach(function (_ref3) {
74
+ var node = _ref3.node,
75
+ offset = _ref3.offset,
76
+ measurement = _ref3.measurement;
77
+ tr = (0, _contentMode.applyTableMeasurement)(tr, node, measurement, offset);
78
+ modified = true;
79
+ });
80
+ if (modified) {
81
+ var _pluginInjectionApi$a, _pluginInjectionApi$w, _pluginInjectionApi$w2;
82
+ pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || (_pluginInjectionApi$a = _pluginInjectionApi$a.actions) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.attachAnalyticsEvent({
83
+ action: _analytics.TABLE_ACTION.FIT_TO_CONTENT_AUTO_CONVERTED,
84
+ actionSubject: _analytics.ACTION_SUBJECT.TABLE,
85
+ actionSubjectId: null,
86
+ eventType: _analytics.EVENT_TYPE.TRACK,
87
+ attributes: {
88
+ editorContainerWidth: (_pluginInjectionApi$w = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$w2 = pluginInjectionApi.width) === null || _pluginInjectionApi$w2 === void 0 || (_pluginInjectionApi$w2 = _pluginInjectionApi$w2.sharedState.currentState()) === null || _pluginInjectionApi$w2 === void 0 ? void 0 : _pluginInjectionApi$w2.width) !== null && _pluginInjectionApi$w !== void 0 ? _pluginInjectionApi$w : 0,
89
+ totalTablesResized: measuredTables.length,
90
+ measurements: measuredTables.map(function (_ref4) {
91
+ var measurement = _ref4.measurement;
92
+ return {
93
+ tableWidth: measurement.tableWidth,
94
+ totalColumnCount: measurement.colWidths.length
95
+ };
96
+ })
97
+ }
98
+ })(tr);
99
+ view.dispatch(tr.setMeta('addToHistory', false));
100
+ }
101
+ };
102
+ var applyMeasuredWidthToSelectedTable = exports.applyMeasuredWidthToSelectedTable = function applyMeasuredWidthToSelectedTable(view, api) {
103
+ var _api$analytics, _api$width$sharedStat, _api$width;
104
+ var tableObject = (0, _utils.findTable)(view.state.selection);
105
+ if (!tableObject) {
106
+ return;
107
+ }
108
+ var node = tableObject.node,
109
+ pos = tableObject.pos;
110
+ var tableState = api === null || api === void 0 ? void 0 : api.table.sharedState.currentState();
111
+ if (!(tableState !== null && tableState !== void 0 && tableState.tableRef)) {
112
+ return;
113
+ }
114
+ var tableRef = tableState.tableRef;
115
+
116
+ // Instead of dispatching a transaction to "strip widths" and then waiting
117
+ // for a rAF to measure natural column widths, instea directly update the DOM elements and
118
+ // take a measurement.
119
+ var cols = Array.from(tableRef.querySelectorAll(':scope > colgroup > col'));
120
+ var contentWrap = tableRef.closest(".".concat(_styles.TableSharedCssClassName.TABLE_VIEW_CONTENT_WRAP));
121
+ var resizerContainer = contentWrap === null || contentWrap === void 0 ? void 0 : contentWrap.querySelector(".".concat(_styles.TableSharedCssClassName.TABLE_RESIZER_CONTAINER));
122
+ var resizerItem = resizerContainer === null || resizerContainer === void 0 ? void 0 : resizerContainer.querySelector('.resizer-item.display-handle');
123
+ tableRef.style.width = '';
124
+ tableRef.style.tableLayout = 'auto';
125
+ cols.forEach(function (col) {
126
+ return col.style.width = '';
127
+ });
128
+ if (resizerContainer) {
129
+ resizerContainer.style.width = 'max-content';
130
+ resizerContainer.style.setProperty('--ak-editor-table-width', 'max-content');
131
+ }
132
+ if (resizerItem) {
133
+ resizerItem.style.width = 'max-content';
134
+ }
135
+ var measurement = (0, _contentMode.getTableMeasurement)(tableRef);
136
+ var tr = (0, _contentMode.applyTableMeasurement)(view.state.tr, node, measurement, pos);
137
+ api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 || _api$analytics.attachAnalyticsEvent({
138
+ action: _analytics.TABLE_ACTION.FIT_TO_CONTENT_ON_DEMAND,
139
+ actionSubject: _analytics.ACTION_SUBJECT.TABLE,
140
+ actionSubjectId: null,
141
+ eventType: _analytics.EVENT_TYPE.TRACK,
142
+ attributes: {
143
+ editorContainerWidth: (_api$width$sharedStat = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 || (_api$width = _api$width.sharedState.currentState()) === null || _api$width === void 0 ? void 0 : _api$width.width) !== null && _api$width$sharedStat !== void 0 ? _api$width$sharedStat : 0,
144
+ tableWidth: measurement.tableWidth,
145
+ totalColumnCount: measurement.colWidths.length
146
+ }
147
+ })(tr);
148
+ view.dispatch(tr);
149
+ };
@@ -10,6 +10,7 @@ exports.withCellTracking = exports.whenTableInFocus = exports.isTableInFocus = v
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
12
12
  var _analytics = require("@atlaskit/editor-common/analytics");
13
+ var _browser = require("@atlaskit/editor-common/browser");
13
14
  var _nesting = require("@atlaskit/editor-common/nesting");
14
15
  var _utils = require("@atlaskit/editor-common/utils");
15
16
  var _state5 = require("@atlaskit/editor-prosemirror/state");
@@ -48,7 +49,7 @@ var handleBlur = exports.handleBlur = function handleBlur(view, event) {
48
49
  dispatch = view.dispatch;
49
50
  // IE version check for ED-4665
50
51
  // Calendar focus check for ED-10466
51
- if (_utils.browser.ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event) && !isFocusingDragHandles(event) && !isFocusingDragHandlesClickableZone(event)) {
52
+ if ((0, _browser.getBrowserInfo)().ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event) && !isFocusingDragHandles(event) && !isFocusingDragHandlesClickableZone(event)) {
52
53
  (0, _commands.setEditorFocus)(false)(state, dispatch);
53
54
  }
54
55
  event.preventDefault();
@@ -358,7 +359,7 @@ var handleMouseMove = exports.handleMouseMove = function handleMouseMove(nodeVie
358
359
  // a reflow. So for now this will just grab the offsetX value immediately for gecko and chrome will calculate later
359
360
  // in the deferred callback handler.
360
361
  // Bug Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1882903
361
- handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, _utils.browser.gecko ? event.offsetX : NaN);
362
+ handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, (0, _browser.getBrowserInfo)().gecko ? event.offsetX : NaN);
362
363
  return false;
363
364
  };
364
365
  };