@atlaskit/editor-plugin-table 12.1.11 → 12.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 12.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#195989](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195989)
8
+ [`4132618fc5097`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4132618fc5097) -
9
+ EDITOR-1146 Remove usage of FG `platform_editor_sort_decoration_fix_on_live_page`
10
+ - Updated dependencies
11
+
3
12
  ## 12.1.11
4
13
 
5
14
  ### Patch Changes
@@ -15,7 +15,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
15
15
  var _types = require("@atlaskit/editor-common/types");
16
16
  var _view = require("@atlaskit/editor-prosemirror/view");
17
17
  var _tableMap = require("@atlaskit/editor-tables/table-map");
18
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
18
  var _SortingIconWrapper = require("../../ui/icons/SortingIconWrapper");
20
19
  var _pluginFactory = require("../plugin-factory");
21
20
  var _consts = require("./consts");
@@ -51,9 +50,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
51
50
  var _sortingDecorations = pluginState === null || pluginState === void 0 || (_pluginState$decorati = pluginState.decorations) === null || _pluginState$decorati === void 0 ? void 0 : _pluginState$decorati.find(undefined, undefined, function (s) {
52
51
  return (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration';
53
52
  });
54
- return (0, _platformFeatureFlags.fg)('platform_editor_sort_decoration_fix_on_live_page') ? _objectSpread(_objectSpread({}, pluginState), {}, {
53
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
55
54
  decorations: pluginState === null || pluginState === void 0 || (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(_sortingDecorations)
56
- }) : pluginState;
55
+ });
57
56
  }
58
57
  var decorations = pluginState.decorations,
59
58
  sort = pluginState.sort,
@@ -99,7 +98,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
99
98
  });
100
99
 
101
100
  // TODO: ED-26961 - add support for keyboard only users
102
- if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length && (0, _platformFeatureFlags.fg)('platform_editor_sort_decoration_fix_on_live_page')) {
101
+ if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
103
102
  allTables.forEach(function (table) {
104
103
  var _table = (0, _slicedToArray2.default)(table, 3),
105
104
  tableId = _table[0],
@@ -11,7 +11,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
11
11
  import { SortOrder } from '@atlaskit/editor-common/types';
12
12
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
13
13
  import { TableMap } from '@atlaskit/editor-tables/table-map';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
16
15
  import { getPluginState } from '../plugin-factory';
17
16
  import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
@@ -35,10 +34,10 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
35
34
  if (mode !== 'view') {
36
35
  var _pluginState$decorati, _pluginState$decorati2;
37
36
  const sortingDecorations = pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$decorati = pluginState.decorations) === null || _pluginState$decorati === void 0 ? void 0 : _pluginState$decorati.find(undefined, undefined, s => (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration');
38
- return fg('platform_editor_sort_decoration_fix_on_live_page') ? {
37
+ return {
39
38
  ...pluginState,
40
39
  decorations: pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(sortingDecorations)
41
- } : pluginState;
40
+ };
42
41
  }
43
42
  let {
44
43
  decorations,
@@ -75,7 +74,7 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
75
74
  const sortingDecorations = pluginState.decorations.find(undefined, undefined, spec => spec.tableId === tableId && spec.type === 'sorting-decoration');
76
75
 
77
76
  // TODO: ED-26961 - add support for keyboard only users
78
- if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length && fg('platform_editor_sort_decoration_fix_on_live_page')) {
77
+ if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
79
78
  allTables.forEach(table => {
80
79
  const [tableId, _node, pos] = table;
81
80
  const tableNode = tr.doc.nodeAt(tr.mapping.map(pos));
@@ -19,7 +19,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
19
19
  import { SortOrder } from '@atlaskit/editor-common/types';
20
20
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
21
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
22
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
24
23
  import { getPluginState } from '../plugin-factory';
25
24
  import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
@@ -46,9 +45,9 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
46
45
  var _sortingDecorations = pluginState === null || pluginState === void 0 || (_pluginState$decorati = pluginState.decorations) === null || _pluginState$decorati === void 0 ? void 0 : _pluginState$decorati.find(undefined, undefined, function (s) {
47
46
  return (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration';
48
47
  });
49
- return fg('platform_editor_sort_decoration_fix_on_live_page') ? _objectSpread(_objectSpread({}, pluginState), {}, {
48
+ return _objectSpread(_objectSpread({}, pluginState), {}, {
50
49
  decorations: pluginState === null || pluginState === void 0 || (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(_sortingDecorations)
51
- }) : pluginState;
50
+ });
52
51
  }
53
52
  var decorations = pluginState.decorations,
54
53
  sort = pluginState.sort,
@@ -94,7 +93,7 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
94
93
  });
95
94
 
96
95
  // TODO: ED-26961 - add support for keyboard only users
97
- if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length && fg('platform_editor_sort_decoration_fix_on_live_page')) {
96
+ if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
98
97
  allTables.forEach(function (table) {
99
98
  var _table = _slicedToArray(table, 3),
100
99
  tableId = _table[0],
@@ -6,6 +6,10 @@
6
6
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
7
7
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
8
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
10
  import type tablePlugin from '../../tablePlugin';
10
- import type { ViewModeSortPluginState } from './types';
11
- export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<ViewModeSortPluginState>;
11
+ export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
12
+ decorations: DecorationSet;
13
+ sort: import("./types").TableSortMeta;
14
+ allTables: [string, import("prosemirror-model").Node, number][];
15
+ }>;
@@ -6,6 +6,14 @@
6
6
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
7
7
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
8
8
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
10
  import type tablePlugin from '../../tablePlugin';
10
- import type { ViewModeSortPluginState } from './types';
11
- export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<ViewModeSortPluginState>;
11
+ export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
12
+ decorations: DecorationSet;
13
+ sort: import("./types").TableSortMeta;
14
+ allTables: [
15
+ string,
16
+ import("prosemirror-model").Node,
17
+ number
18
+ ][];
19
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "12.1.11",
3
+ "version": "12.1.12",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/primitives": "^14.11.0",
55
55
  "@atlaskit/react-ufo": "^4.1.0",
56
56
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.23.0",
57
+ "@atlaskit/tmp-editor-statsig": "^9.24.0",
58
58
  "@atlaskit/toggle": "^15.1.0",
59
59
  "@atlaskit/tokens": "^6.0.0",
60
60
  "@atlaskit/tooltip": "^20.4.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^107.16.0",
70
+ "@atlaskit/editor-common": "^107.17.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -145,9 +145,6 @@
145
145
  "platform_editor_nested_tables_sticky_header_bug": {
146
146
  "type": "boolean"
147
147
  },
148
- "platform_editor_sort_decoration_fix_on_live_page": {
149
- "type": "boolean"
150
- },
151
148
  "platform_editor_table_column_selected_state_fix": {
152
149
  "type": "boolean"
153
150
  },
@@ -15,7 +15,6 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
15
15
  import { SortOrder } from '@atlaskit/editor-common/types';
16
16
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
17
17
  import { TableMap } from '@atlaskit/editor-tables/table-map';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
18
 
20
19
  import type tablePlugin from '../../tablePlugin';
21
20
  import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
@@ -52,12 +51,10 @@ export const createPlugin = (
52
51
  (s) => s?.type === 'sorting-decoration',
53
52
  );
54
53
 
55
- return fg('platform_editor_sort_decoration_fix_on_live_page')
56
- ? {
57
- ...pluginState,
58
- decorations: pluginState?.decorations?.remove(sortingDecorations),
59
- }
60
- : pluginState;
54
+ return {
55
+ ...pluginState,
56
+ decorations: pluginState?.decorations?.remove(sortingDecorations),
57
+ };
61
58
  }
62
59
  let { decorations, sort, allTables } = pluginState;
63
60
 
@@ -99,9 +96,7 @@ export const createPlugin = (
99
96
  if (
100
97
  (hoverTableMeta && !isTableInState) ||
101
98
  sortMeta ||
102
- (isTableInState &&
103
- !sortingDecorations.length &&
104
- fg('platform_editor_sort_decoration_fix_on_live_page'))
99
+ (isTableInState && !sortingDecorations.length)
105
100
  ) {
106
101
  allTables.forEach((table) => {
107
102
  const [tableId, _node, pos] = table;