@atlaskit/editor-plugin-table 17.3.15 → 17.3.17

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,22 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 17.3.17
4
+
5
+ ### Patch Changes
6
+
7
+ - [`369400c30a0cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/369400c30a0cc) -
8
+ Cleanup FG platform_editor_change_table_nesting_check
9
+ - [`34c3a60cb9325`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34c3a60cb9325) -
10
+ Cleanup FG platform_editor_fix_confirm_table_removal
11
+
12
+ ## 17.3.16
13
+
14
+ ### Patch Changes
15
+
16
+ - [`b4422f96787ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b4422f96787ee) -
17
+ [ux] Fix contextual menu showing on load before editor being focussed or interactions
18
+ - Updated dependencies
19
+
3
20
  ## 17.3.15
4
21
 
5
22
  ### Patch Changes
@@ -145,6 +145,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
145
145
  var _pluginInjectionApi$e;
146
146
  var parent = (0, _utils2.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
147
147
  var shouldSetTableRef = (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) !== 'view' : parent;
148
+ if ((0, _expValEquals.expValEquals)('platform_editor_table_update_table_ref', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_update_table_ref_fix')) {
149
+ var _pluginInjectionApi$e2, _pluginInjectionApi$i;
150
+ shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 || (_pluginInjectionApi$i = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.interactionState) !== 'hasNotHadInteraction';
151
+ }
148
152
  if (shouldSetTableRef) {
149
153
  tableRef =
150
154
  // Ignored via go/ees005
@@ -9,7 +9,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
9
9
  var _utils = require("@atlaskit/editor-common/utils");
10
10
  var _tableMap = require("@atlaskit/editor-tables/table-map");
11
11
  var _utils2 = require("@atlaskit/editor-tables/utils");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var isIsolating = exports.isIsolating = function isIsolating(node) {
14
13
  return !!node.type.spec.isolating;
15
14
  };
@@ -104,12 +103,7 @@ function getTableWidths(node) {
104
103
  var isTableNested = exports.isTableNested = function isTableNested(state) {
105
104
  var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
106
105
  var $tablePos = state.doc.resolve(tablePos);
107
- var parent = $tablePos.parent;
108
- var nodeTypes = state.schema.nodes;
109
- if ((0, _platformFeatureFlags.fg)('platform_editor_change_table_nesting_check')) {
110
- return $tablePos.depth > 0;
111
- }
112
- return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
106
+ return $tablePos.depth > 0;
113
107
  };
114
108
  var isTableNestedInMoreThanOneNode = exports.isTableNestedInMoreThanOneNode = function isTableNestedInMoreThanOneNode(state) {
115
109
  var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
@@ -615,7 +615,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
615
615
  label: intl.formatMessage(_messages.default.delete)
616
616
  })
617
617
  }, hoverTableProps(true)), {}, {
618
- confirmDialog: (0, _platformFeatureFlags.fg)('platform_editor_fix_confirm_table_removal') ? confirmDialog : undefined
618
+ confirmDialog: confirmDialog
619
619
  })])
620
620
  }])),
621
621
  scrollable: true
@@ -133,7 +133,11 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
133
133
  if (fg('platform_editor_enable_table_dnd')) {
134
134
  var _pluginInjectionApi$e, _pluginInjectionApi$e2;
135
135
  const parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
136
- const shouldSetTableRef = fg('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' : parent;
136
+ let shouldSetTableRef = fg('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' : parent;
137
+ if (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) && fg('platform_editor_update_table_ref_fix')) {
138
+ var _pluginInjectionApi$e3, _pluginInjectionApi$e4, _pluginInjectionApi$i, _pluginInjectionApi$i2;
139
+ shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e3 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : (_pluginInjectionApi$e4 = _pluginInjectionApi$e3.sharedState.currentState()) === null || _pluginInjectionApi$e4 === void 0 ? void 0 : _pluginInjectionApi$e4.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 ? void 0 : (_pluginInjectionApi$i2 = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i2 === void 0 ? void 0 : _pluginInjectionApi$i2.interactionState) !== 'hasNotHadInteraction';
140
+ }
137
141
  if (shouldSetTableRef) {
138
142
  tableRef =
139
143
  // Ignored via go/ees005
@@ -1,7 +1,6 @@
1
1
  import { mapChildren } from '@atlaskit/editor-common/utils';
2
2
  import { TableMap } from '@atlaskit/editor-tables/table-map';
3
3
  import { findTable } from '@atlaskit/editor-tables/utils';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  export const isIsolating = node => {
6
5
  return !!node.type.spec.isolating;
7
6
  };
@@ -85,12 +84,7 @@ function getTableWidths(node) {
85
84
  }
86
85
  export const isTableNested = (state, tablePos = 0) => {
87
86
  const $tablePos = state.doc.resolve(tablePos);
88
- const parent = $tablePos.parent;
89
- const nodeTypes = state.schema.nodes;
90
- if (fg('platform_editor_change_table_nesting_check')) {
91
- return $tablePos.depth > 0;
92
- }
93
- return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
87
+ return $tablePos.depth > 0;
94
88
  };
95
89
  export const isTableNestedInMoreThanOneNode = (state, tablePos = 0) => {
96
90
  return state.doc.resolve(tablePos).depth > 2;
@@ -584,7 +584,7 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
584
584
  label: intl.formatMessage(commonMessages.delete)
585
585
  }),
586
586
  ...hoverTableProps(true),
587
- confirmDialog: fg('platform_editor_fix_confirm_table_removal') ? confirmDialog : undefined
587
+ confirmDialog
588
588
  }]
589
589
  }])],
590
590
  scrollable: true
@@ -138,6 +138,10 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
138
138
  var _pluginInjectionApi$e;
139
139
  var parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
140
140
  var shouldSetTableRef = fg('platform_editor_enable_table_dnd_patch_1') ? parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) !== 'view' : parent;
141
+ if (expValEquals('platform_editor_table_update_table_ref', 'isEnabled', true) && fg('platform_editor_update_table_ref_fix')) {
142
+ var _pluginInjectionApi$e2, _pluginInjectionApi$i;
143
+ shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 || (_pluginInjectionApi$i = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.interactionState) !== 'hasNotHadInteraction';
144
+ }
141
145
  if (shouldSetTableRef) {
142
146
  tableRef =
143
147
  // Ignored via go/ees005
@@ -2,7 +2,6 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { mapChildren } from '@atlaskit/editor-common/utils';
3
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
4
4
  import { findTable } from '@atlaskit/editor-tables/utils';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  export var isIsolating = function isIsolating(node) {
7
6
  return !!node.type.spec.isolating;
8
7
  };
@@ -97,12 +96,7 @@ function getTableWidths(node) {
97
96
  export var isTableNested = function isTableNested(state) {
98
97
  var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
99
98
  var $tablePos = state.doc.resolve(tablePos);
100
- var parent = $tablePos.parent;
101
- var nodeTypes = state.schema.nodes;
102
- if (fg('platform_editor_change_table_nesting_check')) {
103
- return $tablePos.depth > 0;
104
- }
105
- return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame || parent.type === nodeTypes.tableHeader || parent.type === nodeTypes.tableCell;
99
+ return $tablePos.depth > 0;
106
100
  };
107
101
  export var isTableNestedInMoreThanOneNode = function isTableNestedInMoreThanOneNode(state) {
108
102
  var tablePos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
@@ -608,7 +608,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
608
608
  label: intl.formatMessage(commonMessages.delete)
609
609
  })
610
610
  }, hoverTableProps(true)), {}, {
611
- confirmDialog: fg('platform_editor_fix_confirm_table_removal') ? confirmDialog : undefined
611
+ confirmDialog: confirmDialog
612
612
  })])
613
613
  }])),
614
614
  scrollable: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "17.3.15",
3
+ "version": "17.3.17",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
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.16",
40
+ "@atlaskit/editor-plugin-extension": "10.1.0",
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",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^18.0.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^25.1.0",
60
+ "@atlaskit/tmp-editor-statsig": "^25.2.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
62
  "@atlaskit/tokens": "^11.0.0",
63
63
  "@atlaskit/tooltip": "^20.14.0",
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^111.12.0",
73
+ "@atlaskit/editor-common": "^111.13.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"
@@ -124,9 +124,6 @@
124
124
  "platform_editor_adf_with_localid": {
125
125
  "type": "boolean"
126
126
  },
127
- "platform_editor_fix_confirm_table_removal": {
128
- "type": "boolean"
129
- },
130
127
  "platform_editor_content_mode_button_mvp": {
131
128
  "type": "boolean"
132
129
  },
@@ -183,6 +180,9 @@
183
180
  },
184
181
  "platform_editor_enable_table_dnd_patch_1": {
185
182
  "type": "boolean"
183
+ },
184
+ "platform_editor_update_table_ref_fix": {
185
+ "type": "boolean"
186
186
  }
187
187
  }
188
188
  }