@atlaskit/editor-plugin-table 10.6.10 → 10.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139139](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139139)
8
+ [`7f6b665d778dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6b665d778dd) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27499](ED-27499) - the new
10
+ `@atlassian/confluence-presets` package with Confluence `full-page` preset is created
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 10.6.11
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 10.6.10
4
23
 
5
24
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "tablePlugin", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _tablePlugin.default;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "tablesPlugin", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -73,7 +73,7 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
73
73
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
74
74
  * from `@atlaskit/editor-core`.
75
75
  */
76
- var tablesPlugin = function tablesPlugin(_ref) {
76
+ var tablePlugin = function tablePlugin(_ref) {
77
77
  var _api$analytics, _api$accessibilityUti, _options$getEditorFea, _api$analytics2;
78
78
  var options = _ref.config,
79
79
  api = _ref.api;
@@ -631,4 +631,4 @@ var tablesPlugin = function tablesPlugin(_ref) {
631
631
  }
632
632
  };
633
633
  };
634
- var _default = exports.default = tablesPlugin;
634
+ var _default = exports.default = tablePlugin;
@@ -389,8 +389,12 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
389
389
  }
390
390
  var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
391
391
  var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
392
+ var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
392
393
  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;
394
+
395
+ // Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
396
+ // won't be suppressed.
397
+ var shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
394
398
  if (shouldSuppressAllToolbars) {
395
399
  return {
396
400
  title: toolbarTitle,
@@ -1,4 +1,12 @@
1
+ /* eslint-disable @atlaskit/editor/only-export-plugin */
1
2
  /* eslint-disable @atlaskit/editor/no-re-export */
2
3
  // Entry file in package.json
3
4
 
4
- export { default as tablesPlugin } from './tablePlugin';
5
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
6
+ export {
7
+ /**
8
+ * @private
9
+ * @deprecated Use {@link tablePlugin} instead.
10
+ */
11
+ default as tablesPlugin, default as tablePlugin } from './tablePlugin';
12
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
@@ -59,7 +59,7 @@ const defaultGetEditorFeatureFlags = () => ({});
59
59
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
60
60
  * from `@atlaskit/editor-core`.
61
61
  */
62
- const tablesPlugin = ({
62
+ const tablePlugin = ({
63
63
  config: options,
64
64
  api
65
65
  }) => {
@@ -628,4 +628,4 @@ const tablesPlugin = ({
628
628
  }
629
629
  };
630
630
  };
631
- export default tablesPlugin;
631
+ export default tablePlugin;
@@ -367,8 +367,12 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
367
367
  }
368
368
  const isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
369
369
  const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
370
+ const isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
370
371
  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;
372
+
373
+ // Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
374
+ // won't be suppressed.
375
+ const shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
372
376
  if (shouldSuppressAllToolbars) {
373
377
  return {
374
378
  title: toolbarTitle,
package/dist/esm/index.js CHANGED
@@ -1,4 +1,12 @@
1
+ /* eslint-disable @atlaskit/editor/only-export-plugin */
1
2
  /* eslint-disable @atlaskit/editor/no-re-export */
2
3
  // Entry file in package.json
3
4
 
4
- export { default as tablesPlugin } from './tablePlugin';
5
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
6
+ export {
7
+ /**
8
+ * @private
9
+ * @deprecated Use {@link tablePlugin} instead.
10
+ */
11
+ default as tablesPlugin, default as tablePlugin } from './tablePlugin';
12
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
@@ -64,7 +64,7 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
64
64
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
65
65
  * from `@atlaskit/editor-core`.
66
66
  */
67
- var tablesPlugin = function tablesPlugin(_ref) {
67
+ var tablePlugin = function tablePlugin(_ref) {
68
68
  var _api$analytics, _api$accessibilityUti, _options$getEditorFea, _api$analytics2;
69
69
  var options = _ref.config,
70
70
  api = _ref.api;
@@ -622,4 +622,4 @@ var tablesPlugin = function tablesPlugin(_ref) {
622
622
  }
623
623
  };
624
624
  };
625
- export default tablesPlugin;
625
+ export default tablePlugin;
@@ -381,8 +381,12 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
381
381
  }
382
382
  var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
383
383
  var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
384
+ var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
384
385
  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;
386
+
387
+ // Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
388
+ // won't be suppressed.
389
+ var shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
386
390
  if (shouldSuppressAllToolbars) {
387
391
  return {
388
392
  title: toolbarTitle,
@@ -1,2 +1,7 @@
1
- export { default as tablesPlugin } from './tablePlugin';
1
+ export {
2
+ /**
3
+ * @private
4
+ * @deprecated Use {@link tablePlugin} instead.
5
+ */
6
+ default as tablesPlugin, default as tablePlugin, } from './tablePlugin';
2
7
  export type { TablePlugin, TablePluginOptions } from './tablePluginType';
@@ -3,5 +3,5 @@ import type { TablePlugin } from './tablePluginType';
3
3
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
4
4
  * from `@atlaskit/editor-core`.
5
5
  */
6
- declare const tablesPlugin: TablePlugin;
7
- export default tablesPlugin;
6
+ declare const tablePlugin: TablePlugin;
7
+ export default tablePlugin;
@@ -1,2 +1,7 @@
1
- export { default as tablesPlugin } from './tablePlugin';
1
+ export {
2
+ /**
3
+ * @private
4
+ * @deprecated Use {@link tablePlugin} instead.
5
+ */
6
+ default as tablesPlugin, default as tablePlugin, } from './tablePlugin';
2
7
  export type { TablePlugin, TablePluginOptions } from './tablePluginType';
@@ -3,5 +3,5 @@ import type { TablePlugin } from './tablePluginType';
3
3
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
4
4
  * from `@atlaskit/editor-core`.
5
5
  */
6
- declare const tablesPlugin: TablePlugin;
7
- export default tablesPlugin;
6
+ declare const tablePlugin: TablePlugin;
7
+ export default tablePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.6.10",
3
+ "version": "10.7.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,14 +32,14 @@
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.3.0",
35
+ "@atlaskit/editor-common": "^103.4.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",
39
39
  "@atlaskit/editor-plugin-batch-attribute-updates": "^2.1.0",
40
40
  "@atlaskit/editor-plugin-content-insertion": "^2.1.0",
41
- "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
42
- "@atlaskit/editor-plugin-extension": "5.2.2",
41
+ "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
42
+ "@atlaskit/editor-plugin-extension": "5.2.3",
43
43
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
44
44
  "@atlaskit/editor-plugin-selection": "^2.1.0",
45
45
  "@atlaskit/editor-plugin-width": "^3.0.0",
package/src/index.ts CHANGED
@@ -1,5 +1,15 @@
1
+ /* eslint-disable @atlaskit/editor/only-export-plugin */
1
2
  /* eslint-disable @atlaskit/editor/no-re-export */
2
3
  // Entry file in package.json
3
4
 
4
- export { default as tablesPlugin } from './tablePlugin';
5
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
6
+ export {
7
+ /**
8
+ * @private
9
+ * @deprecated Use {@link tablePlugin} instead.
10
+ */
11
+ default as tablesPlugin,
12
+ default as tablePlugin,
13
+ } from './tablePlugin';
14
+ // eslint-disable-next-line @atlaskit/editor/only-export-plugin
5
15
  export type { TablePlugin, TablePluginOptions } from './tablePluginType';
@@ -87,7 +87,7 @@ const defaultGetEditorFeatureFlags = () => ({});
87
87
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
88
88
  * from `@atlaskit/editor-core`.
89
89
  */
90
- const tablesPlugin: TablePlugin = ({ config: options, api }) => {
90
+ const tablePlugin: TablePlugin = ({ config: options, api }) => {
91
91
  const editorViewRef: Record<'current', EditorView | null> = { current: null };
92
92
  const defaultGetEditorContainerWidth: GetEditorContainerWidth = () => {
93
93
  return (
@@ -790,4 +790,4 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
790
790
  };
791
791
  };
792
792
 
793
- export default tablesPlugin;
793
+ export default tablePlugin;
@@ -508,14 +508,13 @@ export const getToolbarConfig =
508
508
 
509
509
  const isTableOrColumnResizing = !!(resizeState?.dragging || tableWidthState?.resizing);
510
510
  const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
511
+ const isTableState =
512
+ isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
511
513
  const isViewMode = api?.editorViewMode?.sharedState.currentState()?.mode === 'view';
512
514
 
513
- const shouldSuppressAllToolbars =
514
- (!pluginState.editorHasFocus && !isViewMode) ||
515
- isTableMenuOpened ||
516
- isTableOrColumnResizing ||
517
- isTableRowOrColumnDragged;
518
-
515
+ // Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
516
+ // won't be suppressed.
517
+ const shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
519
518
  if (shouldSuppressAllToolbars) {
520
519
  return {
521
520
  title: toolbarTitle,