@atlaskit/editor-plugin-expand 2.9.4 → 2.10.0

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,27 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 2.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#159018](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159018)
8
+ [`14d5e189df870`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14d5e189df870) -
9
+ [ux] ED-25367-remove-copy-button-from-view-mode-when-its-the-only-item
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 2.9.5
16
+
17
+ ### Patch Changes
18
+
19
+ - [#159926](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159926)
20
+ [`f60e3e772ea72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f60e3e772ea72) -
21
+ Add null check to fix crash in legacy toolbar while swapping ebetween view and edit mode in love
22
+ pages
23
+ - Updated dependencies
24
+
3
25
  ## 2.9.4
4
26
 
5
27
  ### Patch Changes
@@ -8,17 +8,21 @@ exports.getToolbarConfig = void 0;
8
8
  var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
9
9
  var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
10
10
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _commands = require("./commands");
12
13
  var _pluginFactory = require("./pm-plugins/plugin-factory");
13
14
  var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(api) {
14
15
  return function (state, _ref) {
15
- var _api$decorations$acti, _api$decorations, _api$analytics;
16
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
16
17
  var formatMessage = _ref.formatMessage;
17
18
  var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
18
19
  hoverDecoration = _ref2.hoverDecoration;
19
20
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
20
- var _getPluginState = (0, _pluginFactory.getPluginState)(state),
21
- expandRef = _getPluginState.expandRef;
21
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
22
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
23
+ // For now let's add a null check to ensure we don't crash while we investigate further.
24
+ var _ref3 = (_getPluginState = (0, _pluginFactory.getPluginState)(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {},
25
+ expandRef = _ref3.expandRef;
22
26
  if (expandRef) {
23
27
  var _state$schema$nodes = state.schema.nodes,
24
28
  nestedExpand = _state$schema$nodes.nestedExpand,
@@ -32,7 +36,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(api)
32
36
  offset: [0, 6],
33
37
  items: [{
34
38
  type: 'copy-button',
35
- supportsViewMode: true,
39
+ supportsViewMode: !(0, _platformFeatureFlags.fg)('platform_editor_remove_copy_button_from_view_mode'),
36
40
  items: [{
37
41
  state: state,
38
42
  formatMessage: formatMessage,
@@ -9,6 +9,7 @@ var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages
9
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
10
10
  var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
11
11
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
13
  var _commands = require("./commands");
13
14
  var _utils2 = require("./utils");
14
15
  var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(api) {
@@ -32,7 +33,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(api)
32
33
  offset: [0, 6],
33
34
  items: [{
34
35
  type: 'copy-button',
35
- supportsViewMode: true,
36
+ supportsViewMode: !(0, _platformFeatureFlags.fg)('platform_editor_remove_copy_button_from_view_mode'),
36
37
  items: [{
37
38
  state: state,
38
39
  formatMessage: formatMessage,
@@ -1,19 +1,23 @@
1
1
  import commonMessages from '@atlaskit/editor-common/messages';
2
2
  import DeleteIcon from '@atlaskit/icon/core/delete';
3
3
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { deleteExpand } from './commands';
5
6
  import { getPluginState } from './pm-plugins/plugin-factory';
6
7
  export const getToolbarConfig = api => (state, {
7
8
  formatMessage
8
9
  }) => {
9
- var _api$decorations$acti, _api$decorations, _api$analytics;
10
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
10
11
  const {
11
12
  hoverDecoration
12
13
  } = (_api$decorations$acti = api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {};
13
14
  const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
15
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
16
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
17
+ // For now let's add a null check to ensure we don't crash while we investigate further.
14
18
  const {
15
19
  expandRef
16
- } = getPluginState(state);
20
+ } = (_getPluginState = getPluginState(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {};
17
21
  if (expandRef) {
18
22
  const {
19
23
  nestedExpand,
@@ -26,7 +30,7 @@ export const getToolbarConfig = api => (state, {
26
30
  offset: [0, 6],
27
31
  items: [{
28
32
  type: 'copy-button',
29
- supportsViewMode: true,
33
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
30
34
  items: [{
31
35
  state,
32
36
  formatMessage,
@@ -2,6 +2,7 @@ import commonMessages from '@atlaskit/editor-common/messages';
2
2
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
3
3
  import DeleteIcon from '@atlaskit/icon/core/delete';
4
4
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { deleteExpand } from './commands';
6
7
  import { findParentExpandNode } from './utils';
7
8
  export const getToolbarConfig = api => (state, {
@@ -25,7 +26,7 @@ export const getToolbarConfig = api => (state, {
25
26
  offset: [0, 6],
26
27
  items: [{
27
28
  type: 'copy-button',
28
- supportsViewMode: true,
29
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
29
30
  items: [{
30
31
  state,
31
32
  formatMessage,
@@ -1,17 +1,21 @@
1
1
  import commonMessages from '@atlaskit/editor-common/messages';
2
2
  import DeleteIcon from '@atlaskit/icon/core/delete';
3
3
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { deleteExpand } from './commands';
5
6
  import { getPluginState } from './pm-plugins/plugin-factory';
6
7
  export var getToolbarConfig = function getToolbarConfig(api) {
7
8
  return function (state, _ref) {
8
- var _api$decorations$acti, _api$decorations, _api$analytics;
9
+ var _api$decorations$acti, _api$decorations, _api$analytics, _getPluginState;
9
10
  var formatMessage = _ref.formatMessage;
10
11
  var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
11
12
  hoverDecoration = _ref2.hoverDecoration;
12
13
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
13
- var _getPluginState = getPluginState(state),
14
- expandRef = _getPluginState.expandRef;
14
+ // JST-1060364: We are observing this crashing the editor where the `expandPlugin` doesn't exist
15
+ // in the editor (resulting in `Cannot destructure property 'expandRef' of ...`).
16
+ // For now let's add a null check to ensure we don't crash while we investigate further.
17
+ var _ref3 = (_getPluginState = getPluginState(state)) !== null && _getPluginState !== void 0 ? _getPluginState : {},
18
+ expandRef = _ref3.expandRef;
15
19
  if (expandRef) {
16
20
  var _state$schema$nodes = state.schema.nodes,
17
21
  nestedExpand = _state$schema$nodes.nestedExpand,
@@ -25,7 +29,7 @@ export var getToolbarConfig = function getToolbarConfig(api) {
25
29
  offset: [0, 6],
26
30
  items: [{
27
31
  type: 'copy-button',
28
- supportsViewMode: true,
32
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
29
33
  items: [{
30
34
  state: state,
31
35
  formatMessage: formatMessage,
@@ -2,6 +2,7 @@ import commonMessages from '@atlaskit/editor-common/messages';
2
2
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
3
3
  import DeleteIcon from '@atlaskit/icon/core/delete';
4
4
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { deleteExpand } from './commands';
6
7
  import { findParentExpandNode } from './utils';
7
8
  export var getToolbarConfig = function getToolbarConfig(api) {
@@ -25,7 +26,7 @@ export var getToolbarConfig = function getToolbarConfig(api) {
25
26
  offset: [0, 6],
26
27
  items: [{
27
28
  type: 'copy-button',
28
- supportsViewMode: true,
29
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
29
30
  items: [{
30
31
  state: state,
31
32
  formatMessage: formatMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "2.9.4",
3
+ "version": "2.10.0",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^44.2.0",
35
35
  "@atlaskit/button": "^20.3.0",
36
- "@atlaskit/editor-common": "^94.11.0",
36
+ "@atlaskit/editor-common": "^94.13.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
39
39
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -44,8 +44,8 @@
44
44
  "@atlaskit/editor-tables": "^2.8.0",
45
45
  "@atlaskit/icon": "^22.24.0",
46
46
  "@atlaskit/platform-feature-flags": "^0.3.0",
47
- "@atlaskit/tmp-editor-statsig": "^2.11.0",
48
- "@atlaskit/tokens": "^2.1.0",
47
+ "@atlaskit/tmp-editor-statsig": "^2.12.0",
48
+ "@atlaskit/tokens": "^2.2.0",
49
49
  "@atlaskit/tooltip": "^18.8.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/analytics-next": "^10.1.0",
61
61
  "@atlaskit/editor-plugin-content-insertion": "^1.9.0",
62
62
  "@atlaskit/editor-plugin-guideline": "^1.2.0",
63
- "@atlaskit/editor-plugin-quick-insert": "^1.6.0",
63
+ "@atlaskit/editor-plugin-quick-insert": "^1.7.0",
64
64
  "@atlaskit/editor-plugin-table": "^7.30.0",
65
65
  "@atlaskit/editor-plugin-type-ahead": "^1.10.0",
66
66
  "@atlaskit/editor-plugin-width": "^1.3.0",
@@ -119,6 +119,9 @@
119
119
  },
120
120
  "platform_editor_expand_auto_scroll": {
121
121
  "type": "boolean"
122
+ },
123
+ "platform_editor_remove_copy_button_from_view_mode": {
124
+ "type": "boolean"
122
125
  }
123
126
  }
124
127
  }