@atlaskit/editor-plugin-table 10.6.7 → 10.6.9

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.6.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139053](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139053)
8
+ [`c1c6278a78c4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c1c6278a78c4a) -
9
+ [ux] Adds a new temporary floating toolbar's config option to hide any toolbars when any table's
10
+ menu is opend.
11
+ - Updated dependencies
12
+
13
+ ## 10.6.8
14
+
15
+ ### Patch Changes
16
+
17
+ - [#138977](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138977)
18
+ [`3d812d3a14c39`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d812d3a14c39) -
19
+ [ux] Revert "Adds a new temporary floating toolbar's config option to hide any toolbars when any
20
+ table's menu is opened."
21
+ - Updated dependencies
22
+
3
23
  ## 10.6.7
4
24
 
5
25
  ### Patch Changes
@@ -374,7 +374,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
374
374
  var isTableScalingEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || false;
375
375
  var nodeType = state.schema.nodes.table;
376
376
  var toolbarTitle = 'Table floating controls';
377
- if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_3')) {
377
+ if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_4')) {
378
+ var _api$editorViewMode;
378
379
  var isDragHandleMenuOpened = false;
379
380
  var isTableRowOrColumnDragged = false;
380
381
  if (options !== null && options !== void 0 && options.dragAndDropEnabled) {
@@ -388,7 +389,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
388
389
  }
389
390
  var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
390
391
  var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
391
- var shouldSuppressAllToolbars = !pluginState.editorHasFocus || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
392
+ var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
393
+ var shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
392
394
  if (shouldSuppressAllToolbars) {
393
395
  return {
394
396
  title: toolbarTitle,
@@ -353,7 +353,8 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
353
353
  const isTableScalingEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || false;
354
354
  const nodeType = state.schema.nodes.table;
355
355
  const toolbarTitle = 'Table floating controls';
356
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
356
+ if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
357
+ var _api$editorViewMode, _api$editorViewMode$s;
357
358
  let isDragHandleMenuOpened = false;
358
359
  let isTableRowOrColumnDragged = false;
359
360
  if (options !== null && options !== void 0 && options.dragAndDropEnabled) {
@@ -366,7 +367,8 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
366
367
  }
367
368
  const isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
368
369
  const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
369
- const shouldSuppressAllToolbars = !pluginState.editorHasFocus || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
370
+ const isViewMode = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode) === 'view';
371
+ const shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
370
372
  if (shouldSuppressAllToolbars) {
371
373
  return {
372
374
  title: toolbarTitle,
@@ -366,7 +366,8 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
366
366
  var isTableScalingEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || false;
367
367
  var nodeType = state.schema.nodes.table;
368
368
  var toolbarTitle = 'Table floating controls';
369
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3')) {
369
+ if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_4')) {
370
+ var _api$editorViewMode;
370
371
  var isDragHandleMenuOpened = false;
371
372
  var isTableRowOrColumnDragged = false;
372
373
  if (options !== null && options !== void 0 && options.dragAndDropEnabled) {
@@ -380,7 +381,8 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
380
381
  }
381
382
  var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
382
383
  var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
383
- var shouldSuppressAllToolbars = !pluginState.editorHasFocus || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
384
+ var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
385
+ var shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
384
386
  if (shouldSuppressAllToolbars) {
385
387
  return {
386
388
  title: toolbarTitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.6.7",
3
+ "version": "10.6.9",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/adf-schema": "^47.6.0",
33
33
  "@atlaskit/button": "^23.0.0",
34
34
  "@atlaskit/custom-steps": "^0.11.0",
35
- "@atlaskit/editor-common": "^103.1.0",
35
+ "@atlaskit/editor-common": "^103.2.0",
36
36
  "@atlaskit/editor-palette": "^2.1.0",
37
37
  "@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
38
38
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
55
- "@atlaskit/primitives": "^14.3.0",
55
+ "@atlaskit/primitives": "^14.4.0",
56
56
  "@atlaskit/theme": "^18.0.0",
57
57
  "@atlaskit/tmp-editor-statsig": "^4.6.0",
58
58
  "@atlaskit/toggle": "^15.0.0",
@@ -198,7 +198,7 @@
198
198
  "platform_editor_controls_patch_2": {
199
199
  "type": "boolean"
200
200
  },
201
- "platform_editor_controls_patch_3": {
201
+ "platform_editor_controls_patch_4": {
202
202
  "type": "boolean"
203
203
  }
204
204
  }
@@ -496,7 +496,7 @@ export const getToolbarConfig =
496
496
 
497
497
  if (
498
498
  editorExperiment('platform_editor_controls', 'variant1') &&
499
- fg('platform_editor_controls_patch_3')
499
+ fg('platform_editor_controls_patch_4')
500
500
  ) {
501
501
  let isDragHandleMenuOpened = false;
502
502
  let isTableRowOrColumnDragged = false;
@@ -508,11 +508,14 @@ export const getToolbarConfig =
508
508
 
509
509
  const isTableOrColumnResizing = !!(resizeState?.dragging || tableWidthState?.resizing);
510
510
  const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
511
+ const isViewMode = api?.editorViewMode?.sharedState.currentState()?.mode === 'view';
512
+
511
513
  const shouldSuppressAllToolbars =
512
- !pluginState.editorHasFocus ||
514
+ (!pluginState.editorHasFocus && !isViewMode) ||
513
515
  isTableMenuOpened ||
514
516
  isTableOrColumnResizing ||
515
517
  isTableRowOrColumnDragged;
518
+
516
519
  if (shouldSuppressAllToolbars) {
517
520
  return {
518
521
  title: toolbarTitle,