@atlaskit/editor-plugin-table 16.4.2 → 16.4.4

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,19 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 16.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 16.4.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`b68e8044e4394`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b68e8044e4394) -
14
+ [ux] EDITOR-4416 Set tableRef to fix drop targets not appearing when editor is not focused
15
+ - Updated dependencies
16
+
3
17
  ## 16.4.2
4
18
 
5
19
  ### Patch Changes
@@ -16,6 +16,7 @@ var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
17
  var _editorTables = require("@atlaskit/editor-tables");
18
18
  var _utils3 = require("@atlaskit/editor-tables/utils");
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
21
  var _tableNodeViews = require("../nodeviews/table-node-views");
21
22
  var _plugin = require("../pm-plugins/decorations/plugin");
@@ -139,7 +140,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
139
140
  var selection = state.selection;
140
141
  var pluginState = (0, _pluginFactory.getPluginState)(state);
141
142
  var tableRef;
142
- if (pluginState.editorHasFocus) {
143
+ if ((0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd')) {
143
144
  var parent = (0, _utils2.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
144
145
  if (parent) {
145
146
  tableRef =
@@ -147,6 +148,17 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
147
148
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
148
149
  parent.querySelector('table') || undefined;
149
150
  }
151
+ }
152
+ if (pluginState.editorHasFocus) {
153
+ if (!(0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd')) {
154
+ var _parent = (0, _utils2.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
155
+ if (_parent) {
156
+ tableRef =
157
+ // Ignored via go/ees005
158
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
159
+ _parent.querySelector('table') || undefined;
160
+ }
161
+ }
150
162
  var tableNode = (0, _utils3.findTable)(state.selection);
151
163
  // when keyboard cursor leaves the table we need to stop column resizing
152
164
  var pluginPrevState = (0, _pluginFactory.getPluginState)(prevState);
@@ -8,6 +8,7 @@ import { closestElement } from '@atlaskit/editor-common/utils';
8
8
  import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { TableMap } from '@atlaskit/editor-tables';
10
10
  import { findTable } from '@atlaskit/editor-tables/utils';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  import { tableCellView, tableHeaderView, tableRowView, tableView } from '../nodeviews/table-node-views';
13
14
  import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
@@ -128,7 +129,7 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
128
129
  } = state;
129
130
  const pluginState = getPluginState(state);
130
131
  let tableRef;
131
- if (pluginState.editorHasFocus) {
132
+ if (fg('platform_editor_enable_table_dnd')) {
132
133
  const parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
133
134
  if (parent) {
134
135
  tableRef =
@@ -136,6 +137,17 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
136
137
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
137
138
  parent.querySelector('table') || undefined;
138
139
  }
140
+ }
141
+ if (pluginState.editorHasFocus) {
142
+ if (!fg('platform_editor_enable_table_dnd')) {
143
+ const parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
144
+ if (parent) {
145
+ tableRef =
146
+ // Ignored via go/ees005
147
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
148
+ parent.querySelector('table') || undefined;
149
+ }
150
+ }
139
151
  const tableNode = findTable(state.selection);
140
152
  // when keyboard cursor leaves the table we need to stop column resizing
141
153
  const pluginPrevState = getPluginState(prevState);
@@ -11,6 +11,7 @@ import { closestElement } from '@atlaskit/editor-common/utils';
11
11
  import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
12
12
  import { TableMap } from '@atlaskit/editor-tables';
13
13
  import { findTable } from '@atlaskit/editor-tables/utils';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
16
  import { tableCellView, tableHeaderView, tableRowView, tableView } from '../nodeviews/table-node-views';
16
17
  import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
@@ -132,7 +133,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
132
133
  var selection = state.selection;
133
134
  var pluginState = getPluginState(state);
134
135
  var tableRef;
135
- if (pluginState.editorHasFocus) {
136
+ if (fg('platform_editor_enable_table_dnd')) {
136
137
  var parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
137
138
  if (parent) {
138
139
  tableRef =
@@ -140,6 +141,17 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
140
141
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
141
142
  parent.querySelector('table') || undefined;
142
143
  }
144
+ }
145
+ if (pluginState.editorHasFocus) {
146
+ if (!fg('platform_editor_enable_table_dnd')) {
147
+ var _parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
148
+ if (_parent) {
149
+ tableRef =
150
+ // Ignored via go/ees005
151
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
152
+ _parent.querySelector('table') || undefined;
153
+ }
154
+ }
143
155
  var tableNode = findTable(state.selection);
144
156
  // when keyboard cursor leaves the table we need to stop column resizing
145
157
  var pluginPrevState = getPluginState(prevState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "16.4.2",
3
+ "version": "16.4.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,18 +37,18 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^7.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^7.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^9.0.0",
40
- "@atlaskit/editor-plugin-extension": "10.0.3",
40
+ "@atlaskit/editor-plugin-extension": "10.0.4",
41
41
  "@atlaskit/editor-plugin-guideline": "^7.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^13.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^4.0.0",
44
44
  "@atlaskit/editor-plugin-selection": "^7.0.0",
45
- "@atlaskit/editor-plugin-toolbar": "^4.0.0",
45
+ "@atlaskit/editor-plugin-toolbar": "^4.1.0",
46
46
  "@atlaskit/editor-plugin-user-intent": "^5.0.0",
47
47
  "@atlaskit/editor-plugin-width": "^8.0.0",
48
48
  "@atlaskit/editor-prosemirror": "^7.2.0",
49
49
  "@atlaskit/editor-shared-styles": "^3.10.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
- "@atlaskit/icon": "^29.4.0",
51
+ "@atlaskit/icon": "^30.0.0",
52
52
  "@atlaskit/insm": "^0.2.0",
53
53
  "@atlaskit/menu": "^8.4.0",
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^17.1.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^16.27.0",
60
+ "@atlaskit/tmp-editor-statsig": "^16.30.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
62
  "@atlaskit/tokens": "^10.1.0",
63
63
  "@atlaskit/tooltip": "^20.14.0",