@atlaskit/editor-plugin-table 17.7.1 → 17.7.2

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,16 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 17.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1fd2b267eb592`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1fd2b267eb592) -
8
+ Cleanup `platform_editor_ai_aifc_patch_ga` flag
9
+ - [`ac4a428022f83`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac4a428022f83) -
10
+ [EDITOR-5480] Removes data-borders-ready fix from table and adds border to prosemirror toDOM
11
+ instead
12
+ - Updated dependencies
13
+
3
14
  ## 17.7.1
4
15
 
5
16
  ### Patch Changes
@@ -30,9 +30,7 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
30
30
  var className = _ref.className,
31
31
  style = _ref.style,
32
32
  node = _ref.node,
33
- children = _ref.children,
34
- tableWrapperHeight = _ref.tableWrapperHeight;
35
- var bordersReady = (0, _expValEquals.expValEquals)('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? tableWrapperHeight !== undefined && tableWrapperHeight > 0 : undefined;
33
+ children = _ref.children;
36
34
  return /*#__PURE__*/_react.default.createElement("div", {
37
35
  ref: ref
38
36
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -43,7 +41,6 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
43
41
  className: className,
44
42
  "data-number-column": node.attrs.isNumberColumnEnabled,
45
43
  "data-layout": node.attrs.layout,
46
- "data-borders-ready": bordersReady,
47
44
  "data-testid": "table-container"
48
45
  }, children);
49
46
  });
@@ -345,8 +342,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
345
342
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
346
343
  , {
347
344
  className: className,
348
- node: node,
349
- tableWrapperHeight: tableWrapperHeight
345
+ node: node
350
346
  }, children))));
351
347
  });
352
348
  var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
@@ -405,8 +401,7 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
405
401
  var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
406
402
  var resizableTableWidth = isFullPageAppearance ? (0, _misc.getTableResizerContainerForFullPageWidthInCSS)(node, isTableScalingEnabled) : "calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))";
407
403
  return /*#__PURE__*/_react.default.createElement(InnerContainer, {
408
- node: node,
409
- tableWrapperHeight: tableWrapperHeight
404
+ node: node
410
405
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
411
406
  ,
412
407
  className: (0, _classnames.default)(className, {
@@ -17,7 +17,6 @@ var _nesting = require("@atlaskit/editor-common/nesting");
17
17
  var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
18
18
  var _ui = require("@atlaskit/editor-common/ui");
19
19
  var _utils = require("@atlaskit/editor-prosemirror/utils");
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _pluginFactory = require("../pm-plugins/plugin-factory");
22
21
  var _pluginKey = require("../pm-plugins/plugin-key");
23
22
  var _commands = require("../pm-plugins/sticky-headers/commands");
@@ -101,20 +100,16 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
101
100
  }
102
101
  var pos = _this.getPos();
103
102
  _this.isInNestedTable = false;
104
- if ((0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_patch_ga')) {
105
- try {
106
- // We cannot trust that the value from getPos will be defined
107
- // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
108
- // There are also scenarios where the value it brings back does not tally with the current doc
109
- // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
110
- if (pos) {
111
- _this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
112
- }
113
- } catch (e) {}
114
- } else {
103
+ try {
104
+ // We cannot trust that the value from getPos will be defined
105
+ // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
106
+ // There are also scenarios where the value it brings back does not tally with the current doc
107
+ // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
115
108
  if (pos) {
116
109
  _this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
117
110
  }
111
+ } catch (_unused) {
112
+ // Intentionally swallowed — getPos can return stale positions during AI streaming
118
113
  }
119
114
  if (_this.isHeaderRow) {
120
115
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -62,7 +62,16 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
62
62
  }, ['table', attrs, colgroup, ['tbody', 0]]], ['div', {
63
63
  class: 'pm-table-sticky-sentinel-bottom',
64
64
  'data-testid': 'sticky-sentinel-bottom'
65
- }]];
65
+ }]].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? [['div', {
66
+ contenteditable: 'false',
67
+ class: 'pm-table-left-border',
68
+ 'data-with-numbered-table': node.attrs.isNumberColumnEnabled,
69
+ 'data-testid': 'table-left-border'
70
+ }], ['div', {
71
+ contenteditable: 'false',
72
+ class: 'pm-table-right-border',
73
+ 'data-testid': 'table-right-border'
74
+ }]] : []));
66
75
  if (!config.tableResizingEnabled || config.isNested) {
67
76
  return ['div', {
68
77
  class: 'tableView-content-wrap',
@@ -20,10 +20,8 @@ const InnerContainer = /*#__PURE__*/forwardRef(({
20
20
  className,
21
21
  style,
22
22
  node,
23
- children,
24
- tableWrapperHeight
23
+ children
25
24
  }, ref) => {
26
- const bordersReady = expValEquals('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? tableWrapperHeight !== undefined && tableWrapperHeight > 0 : undefined;
27
25
  return /*#__PURE__*/React.createElement("div", {
28
26
  ref: ref
29
27
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -34,7 +32,6 @@ const InnerContainer = /*#__PURE__*/forwardRef(({
34
32
  className: className,
35
33
  "data-number-column": node.attrs.isNumberColumnEnabled,
36
34
  "data-layout": node.attrs.layout,
37
- "data-borders-ready": bordersReady,
38
35
  "data-testid": "table-container"
39
36
  }, children);
40
37
  });
@@ -339,8 +336,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
339
336
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
340
337
  , {
341
338
  className: className,
342
- node: node,
343
- tableWrapperHeight: tableWrapperHeight
339
+ node: node
344
340
  }, children))));
345
341
  });
346
342
  export const TableContainer = ({
@@ -402,8 +398,7 @@ export const TableContainer = ({
402
398
  const isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
403
399
  const resizableTableWidth = isFullPageAppearance ? getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled) : `calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))`;
404
400
  return /*#__PURE__*/React.createElement(InnerContainer, {
405
- node: node,
406
- tableWrapperHeight: tableWrapperHeight
401
+ node: node
407
402
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
408
403
  ,
409
404
  className: classNames(className, {
@@ -5,7 +5,6 @@ import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
5
5
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
6
6
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
7
7
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { getPluginState } from '../pm-plugins/plugin-factory';
10
9
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
11
10
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -86,20 +85,16 @@ export default class TableRow extends TableNodeView {
86
85
  }
87
86
  const pos = this.getPos();
88
87
  this.isInNestedTable = false;
89
- if (fg('platform_editor_ai_aifc_patch_ga')) {
90
- try {
91
- // We cannot trust that the value from getPos will be defined
92
- // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
93
- // There are also scenarios where the value it brings back does not tally with the current doc
94
- // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
95
- if (pos) {
96
- this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
97
- }
98
- } catch (e) {}
99
- } else {
88
+ try {
89
+ // We cannot trust that the value from getPos will be defined
90
+ // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
91
+ // There are also scenarios where the value it brings back does not tally with the current doc
92
+ // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
100
93
  if (pos) {
101
94
  this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
102
95
  }
96
+ } catch {
97
+ // Intentionally swallowed — getPos can return stale positions during AI streaming
103
98
  }
104
99
  if (this.isHeaderRow) {
105
100
  this.dom.setAttribute('data-vc-nvs', 'true');
@@ -46,7 +46,16 @@ export const tableNodeSpecWithFixedToDOM = config => {
46
46
  }, ['table', attrs, colgroup, ['tbody', 0]]], ['div', {
47
47
  class: 'pm-table-sticky-sentinel-bottom',
48
48
  'data-testid': 'sticky-sentinel-bottom'
49
- }]];
49
+ }], ...(expValEquals('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? [['div', {
50
+ contenteditable: 'false',
51
+ class: 'pm-table-left-border',
52
+ 'data-with-numbered-table': node.attrs.isNumberColumnEnabled,
53
+ 'data-testid': 'table-left-border'
54
+ }], ['div', {
55
+ contenteditable: 'false',
56
+ class: 'pm-table-right-border',
57
+ 'data-testid': 'table-right-border'
58
+ }]] : [])];
50
59
  if (!config.tableResizingEnabled || config.isNested) {
51
60
  return ['div', {
52
61
  class: 'tableView-content-wrap',
@@ -21,9 +21,7 @@ var InnerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
21
21
  var className = _ref.className,
22
22
  style = _ref.style,
23
23
  node = _ref.node,
24
- children = _ref.children,
25
- tableWrapperHeight = _ref.tableWrapperHeight;
26
- var bordersReady = expValEquals('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? tableWrapperHeight !== undefined && tableWrapperHeight > 0 : undefined;
24
+ children = _ref.children;
27
25
  return /*#__PURE__*/React.createElement("div", {
28
26
  ref: ref
29
27
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -34,7 +32,6 @@ var InnerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
34
32
  className: className,
35
33
  "data-number-column": node.attrs.isNumberColumnEnabled,
36
34
  "data-layout": node.attrs.layout,
37
- "data-borders-ready": bordersReady,
38
35
  "data-testid": "table-container"
39
36
  }, children);
40
37
  });
@@ -336,8 +333,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
336
333
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
337
334
  , {
338
335
  className: className,
339
- node: node,
340
- tableWrapperHeight: tableWrapperHeight
336
+ node: node
341
337
  }, children))));
342
338
  });
343
339
  export var TableContainer = function TableContainer(_ref5) {
@@ -396,8 +392,7 @@ export var TableContainer = function TableContainer(_ref5) {
396
392
  var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
397
393
  var resizableTableWidth = isFullPageAppearance ? getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled) : "calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))";
398
394
  return /*#__PURE__*/React.createElement(InnerContainer, {
399
- node: node,
400
- tableWrapperHeight: tableWrapperHeight
395
+ node: node
401
396
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
402
397
  ,
403
398
  className: classNames(className, {
@@ -12,7 +12,6 @@ import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
12
12
  import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
13
13
  import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
14
14
  import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
15
  import { getPluginState } from '../pm-plugins/plugin-factory';
17
16
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
18
17
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -94,20 +93,16 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
94
93
  }
95
94
  var pos = _this.getPos();
96
95
  _this.isInNestedTable = false;
97
- if (fg('platform_editor_ai_aifc_patch_ga')) {
98
- try {
99
- // We cannot trust that the value from getPos will be defined
100
- // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
101
- // There are also scenarios where the value it brings back does not tally with the current doc
102
- // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
103
- if (pos) {
104
- _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
105
- }
106
- } catch (e) {}
107
- } else {
96
+ try {
97
+ // We cannot trust that the value from getPos will be defined
98
+ // https://discuss.prosemirror.net/t/getpos-is-undefined-in-nodeview-constructor/1246/4
99
+ // There are also scenarios where the value it brings back does not tally with the current doc
100
+ // E.g. when AI streaming brings in new content, this position brings back incorrect values that cannot be resolved
108
101
  if (pos) {
109
102
  _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
110
103
  }
104
+ } catch (_unused) {
105
+ // Intentionally swallowed — getPos can return stale positions during AI streaming
111
106
  }
112
107
  if (_this.isHeaderRow) {
113
108
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -55,7 +55,16 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
55
55
  }, ['table', attrs, colgroup, ['tbody', 0]]], ['div', {
56
56
  class: 'pm-table-sticky-sentinel-bottom',
57
57
  'data-testid': 'sticky-sentinel-bottom'
58
- }]];
58
+ }]].concat(_toConsumableArray(expValEquals('platform_editor_vc90_transition_table_border', 'isEnabled', true) ? [['div', {
59
+ contenteditable: 'false',
60
+ class: 'pm-table-left-border',
61
+ 'data-with-numbered-table': node.attrs.isNumberColumnEnabled,
62
+ 'data-testid': 'table-left-border'
63
+ }], ['div', {
64
+ contenteditable: 'false',
65
+ class: 'pm-table-right-border',
66
+ 'data-testid': 'table-right-border'
67
+ }]] : []));
59
68
  if (!config.tableResizingEnabled || config.isNested) {
60
69
  return ['div', {
61
70
  class: 'tableView-content-wrap',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "17.7.1",
3
+ "version": "17.7.2",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/editor-plugin-guideline": "^7.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^14.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^4.0.0",
44
- "@atlaskit/editor-plugin-selection": "^7.0.0",
44
+ "@atlaskit/editor-plugin-selection": "^7.1.0",
45
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.1.0",
@@ -57,9 +57,9 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^18.0.0",
59
59
  "@atlaskit/theme": "^22.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^35.0.0",
60
+ "@atlaskit/tmp-editor-statsig": "^35.5.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
- "@atlaskit/tokens": "^11.0.0",
62
+ "@atlaskit/tokens": "^11.1.0",
63
63
  "@atlaskit/tooltip": "^20.14.0",
64
64
  "@babel/runtime": "^7.0.0",
65
65
  "@emotion/react": "^11.7.1",
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^111.30.0",
73
+ "@atlaskit/editor-common": "^111.32.0",
74
74
  "react": "^18.2.0",
75
75
  "react-dom": "^18.2.0",
76
76
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -136,9 +136,6 @@
136
136
  "platform_editor_table_height_analytics_event": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform_editor_ai_aifc_patch_ga": {
140
- "type": "boolean"
141
- },
142
139
  "platform_editor_change_table_nesting_check": {
143
140
  "type": "boolean"
144
141
  },