@atlaskit/editor-plugin-table 15.3.22 → 15.3.23

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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 15.3.23
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
8
+ EDITOR-2791 bump adf-schema
9
+ - Updated dependencies
10
+
3
11
  ## 15.3.22
4
12
 
5
13
  ### Patch Changes
@@ -17,6 +17,7 @@ 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");
20
21
  var _pluginFactory = require("../pm-plugins/plugin-factory");
21
22
  var _pluginKey = require("../pm-plugins/plugin-key");
22
23
  var _commands = require("../pm-plugins/sticky-headers/commands");
@@ -100,8 +101,20 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
100
101
  }
101
102
  var pos = _this.getPos();
102
103
  _this.isInNestedTable = false;
103
- if (pos) {
104
- _this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
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 {
115
+ if (pos) {
116
+ _this.isInNestedTable = (0, _nesting.getParentOfTypeCount)(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
117
+ }
105
118
  }
106
119
  if (_this.isHeaderRow) {
107
120
  _this.dom.setAttribute('data-vc-nvs', 'true');
@@ -5,6 +5,7 @@ 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';
8
9
  import { getPluginState } from '../pm-plugins/plugin-factory';
9
10
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
10
11
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -85,8 +86,20 @@ export default class TableRow extends TableNodeView {
85
86
  }
86
87
  const pos = this.getPos();
87
88
  this.isInNestedTable = false;
88
- if (pos) {
89
- this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
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 {
100
+ if (pos) {
101
+ this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
102
+ }
90
103
  }
91
104
  if (this.isHeaderRow) {
92
105
  this.dom.setAttribute('data-vc-nvs', 'true');
@@ -12,6 +12,7 @@ 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';
15
16
  import { getPluginState } from '../pm-plugins/plugin-factory';
16
17
  import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
17
18
  import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
@@ -93,8 +94,20 @@ var TableRow = /*#__PURE__*/function (_TableNodeView) {
93
94
  }
94
95
  var pos = _this.getPos();
95
96
  _this.isInNestedTable = false;
96
- if (pos) {
97
- _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
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 {
108
+ if (pos) {
109
+ _this.isInNestedTable = getParentOfTypeCount(view.state.schema.nodes.table)(view.state.doc.resolve(pos)) > 1;
110
+ }
98
111
  }
99
112
  if (_this.isHeaderRow) {
100
113
  _this.dom.setAttribute('data-vc-nvs', 'true');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "15.3.22",
3
+ "version": "15.3.23",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,7 +28,7 @@
28
28
  "singleton": true
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^51.3.2",
31
+ "@atlaskit/adf-schema": "^51.4.0",
32
32
  "@atlaskit/button": "^23.6.0",
33
33
  "@atlaskit/custom-steps": "^0.16.0",
34
34
  "@atlaskit/editor-palette": "^2.1.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^6.1.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^6.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
40
- "@atlaskit/editor-plugin-extension": "9.2.3",
40
+ "@atlaskit/editor-plugin-extension": "9.2.4",
41
41
  "@atlaskit/editor-plugin-guideline": "^6.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^10.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^3.1.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
47
47
  "@atlaskit/editor-plugin-width": "^7.0.0",
48
48
  "@atlaskit/editor-prosemirror": "7.0.0",
49
- "@atlaskit/editor-shared-styles": "^3.9.0",
49
+ "@atlaskit/editor-shared-styles": "^3.10.0",
50
50
  "@atlaskit/editor-tables": "^2.9.0",
51
51
  "@atlaskit/icon": "^29.0.0",
52
52
  "@atlaskit/insm": "^0.2.0",
@@ -57,12 +57,12 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
58
58
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
59
59
  "@atlaskit/primitives": "^16.1.0",
60
- "@atlaskit/react-ufo": "^4.14.0",
60
+ "@atlaskit/react-ufo": "^4.15.0",
61
61
  "@atlaskit/theme": "^21.0.0",
62
62
  "@atlaskit/tmp-editor-statsig": "^13.38.0",
63
63
  "@atlaskit/toggle": "^15.1.0",
64
64
  "@atlaskit/tokens": "^8.0.0",
65
- "@atlaskit/tooltip": "^20.8.0",
65
+ "@atlaskit/tooltip": "^20.9.0",
66
66
  "@babel/runtime": "^7.0.0",
67
67
  "@emotion/react": "^11.7.1",
68
68
  "classnames": "^2.2.5",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^3.1.0"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^110.30.0",
75
+ "@atlaskit/editor-common": "^110.32.0",
76
76
  "react": "^18.2.0",
77
77
  "react-dom": "^18.2.0",
78
78
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -150,6 +150,9 @@
150
150
  },
151
151
  "platform_editor_table_height_analytics_event": {
152
152
  "type": "boolean"
153
+ },
154
+ "platform_editor_ai_aifc_patch_ga": {
155
+ "type": "boolean"
153
156
  }
154
157
  }
155
158
  }