@atlaskit/editor-plugin-panel 3.3.0 → 3.3.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,19 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 3.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 3.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#112186](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112186)
14
+ [`9462d8ca2405a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9462d8ca2405a) -
15
+ Bump adf-schema to 47.2.1
16
+
3
17
  ## 3.3.0
4
18
 
5
19
  ### Minor Changes
@@ -8,7 +8,6 @@ exports.panelIcons = exports.getPanelNodeView = exports.PanelIcon = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
- var _reactDom = _interopRequireDefault(require("react-dom"));
12
11
  var _v = _interopRequireDefault(require("uuid/v4"));
13
12
  var _adfSchema = require("@atlaskit/adf-schema");
14
13
  var _emoji = require("@atlaskit/editor-common/emoji");
@@ -61,7 +60,9 @@ var PanelIcon = exports.PanelIcon = function PanelIcon(props) {
61
60
  });
62
61
  }
63
62
  var Icon = panelIcons[panelType];
64
- return /*#__PURE__*/_react.default.createElement(Icon, {
63
+ return (0, _platformFeatureFlags.fg)('platform_editor_update_panel_icon_aria_label') ? /*#__PURE__*/_react.default.createElement(Icon, {
64
+ label: "".concat(panelType, " panel")
65
+ }) : /*#__PURE__*/_react.default.createElement(Icon, {
65
66
  label: "Panel ".concat(panelType)
66
67
  });
67
68
  };
@@ -93,23 +94,14 @@ var PanelNodeView = /*#__PURE__*/function () {
93
94
  }
94
95
  // set contentEditable as false to be able to select the custom panels with keyboard
95
96
  this.icon.contentEditable = 'false';
96
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
97
- this.nodeViewPortalProviderAPI.render(function () {
98
- return /*#__PURE__*/_react.default.createElement(PanelIcon, {
99
- pluginInjectionApi: api,
100
- allowCustomPanel: pluginOptions.allowCustomPanel,
101
- panelAttributes: node.attrs,
102
- providerFactory: _this.providerFactory
103
- });
104
- }, this.icon, this.key);
105
- } else {
106
- _reactDom.default.render( /*#__PURE__*/_react.default.createElement(PanelIcon, {
97
+ this.nodeViewPortalProviderAPI.render(function () {
98
+ return /*#__PURE__*/_react.default.createElement(PanelIcon, {
107
99
  pluginInjectionApi: api,
108
100
  allowCustomPanel: pluginOptions.allowCustomPanel,
109
101
  panelAttributes: node.attrs,
110
- providerFactory: this.providerFactory
111
- }), this.icon);
112
- }
102
+ providerFactory: _this.providerFactory
103
+ });
104
+ }, this.icon, this.key);
113
105
  }
114
106
  return (0, _createClass2.default)(PanelNodeView, [{
115
107
  key: "ignoreMutation",
@@ -126,9 +118,7 @@ var PanelNodeView = /*#__PURE__*/function () {
126
118
  }, {
127
119
  key: "destroy",
128
120
  value: function destroy() {
129
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
130
- this.nodeViewPortalProviderAPI.remove(this.key);
131
- }
121
+ this.nodeViewPortalProviderAPI.remove(this.key);
132
122
  }
133
123
  }]);
134
124
  }();
@@ -28,7 +28,6 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
28
28
  var _removeEmoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove-emoji"));
29
29
  var _success2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
30
30
  var _warning2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/warning"));
31
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
32
31
  var _actions = require("../editor-actions/actions");
33
32
  var _utils2 = require("../pm-plugins/utils/utils");
34
33
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -249,7 +248,6 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
249
248
  });
250
249
  items.push({
251
250
  type: 'copy-button',
252
- supportsViewMode: !(0, _platformFeatureFlags.fg)('platform_editor_remove_copy_button_from_view_mode'),
253
251
  items: [{
254
252
  state: state,
255
253
  formatMessage: formatMessage,
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import ReactDOM from 'react-dom';
3
2
  import uuid from 'uuid/v4';
4
3
  import { PanelType } from '@atlaskit/adf-schema';
5
4
  import { Emoji } from '@atlaskit/editor-common/emoji';
@@ -57,7 +56,9 @@ export const PanelIcon = props => {
57
56
  });
58
57
  }
59
58
  const Icon = panelIcons[panelType];
60
- return /*#__PURE__*/React.createElement(Icon, {
59
+ return fg('platform_editor_update_panel_icon_aria_label') ? /*#__PURE__*/React.createElement(Icon, {
60
+ label: `${panelType} panel`
61
+ }) : /*#__PURE__*/React.createElement(Icon, {
61
62
  label: `Panel ${panelType}`
62
63
  });
63
64
  };
@@ -88,21 +89,12 @@ class PanelNodeView {
88
89
  }
89
90
  // set contentEditable as false to be able to select the custom panels with keyboard
90
91
  this.icon.contentEditable = 'false';
91
- if (fg('platform_editor_react18_plugin_portalprovider')) {
92
- this.nodeViewPortalProviderAPI.render(() => /*#__PURE__*/React.createElement(PanelIcon, {
93
- pluginInjectionApi: api,
94
- allowCustomPanel: pluginOptions.allowCustomPanel,
95
- panelAttributes: node.attrs,
96
- providerFactory: this.providerFactory
97
- }), this.icon, this.key);
98
- } else {
99
- ReactDOM.render( /*#__PURE__*/React.createElement(PanelIcon, {
100
- pluginInjectionApi: api,
101
- allowCustomPanel: pluginOptions.allowCustomPanel,
102
- panelAttributes: node.attrs,
103
- providerFactory: this.providerFactory
104
- }), this.icon);
105
- }
92
+ this.nodeViewPortalProviderAPI.render(() => /*#__PURE__*/React.createElement(PanelIcon, {
93
+ pluginInjectionApi: api,
94
+ allowCustomPanel: pluginOptions.allowCustomPanel,
95
+ panelAttributes: node.attrs,
96
+ providerFactory: this.providerFactory
97
+ }), this.icon, this.key);
106
98
  }
107
99
  ignoreMutation(mutation) {
108
100
  // ignore mutation if it caused by the icon.
@@ -115,9 +107,7 @@ class PanelNodeView {
115
107
  return isIcon || isInsideIcon;
116
108
  }
117
109
  destroy() {
118
- if (fg('platform_editor_react18_plugin_portalprovider')) {
119
- this.nodeViewPortalProviderAPI.remove(this.key);
120
- }
110
+ this.nodeViewPortalProviderAPI.remove(this.key);
121
111
  }
122
112
  }
123
113
  export const getPanelNodeView = (pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) => (node, view, getPos) => {
@@ -19,7 +19,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
19
19
  import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
20
20
  import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
21
21
  import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
22
  import { changePanelType, removePanel } from '../editor-actions/actions';
24
23
  import { findPanel } from '../pm-plugins/utils/utils';
25
24
  export const panelIconMap = {
@@ -233,7 +232,6 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
233
232
  });
234
233
  items.push({
235
234
  type: 'copy-button',
236
- supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
237
235
  items: [{
238
236
  state,
239
237
  formatMessage,
@@ -1,7 +1,6 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import React from 'react';
4
- import ReactDOM from 'react-dom';
5
4
  import uuid from 'uuid/v4';
6
5
  import { PanelType } from '@atlaskit/adf-schema';
7
6
  import { Emoji } from '@atlaskit/editor-common/emoji';
@@ -55,7 +54,9 @@ export var PanelIcon = function PanelIcon(props) {
55
54
  });
56
55
  }
57
56
  var Icon = panelIcons[panelType];
58
- return /*#__PURE__*/React.createElement(Icon, {
57
+ return fg('platform_editor_update_panel_icon_aria_label') ? /*#__PURE__*/React.createElement(Icon, {
58
+ label: "".concat(panelType, " panel")
59
+ }) : /*#__PURE__*/React.createElement(Icon, {
59
60
  label: "Panel ".concat(panelType)
60
61
  });
61
62
  };
@@ -87,23 +88,14 @@ var PanelNodeView = /*#__PURE__*/function () {
87
88
  }
88
89
  // set contentEditable as false to be able to select the custom panels with keyboard
89
90
  this.icon.contentEditable = 'false';
90
- if (fg('platform_editor_react18_plugin_portalprovider')) {
91
- this.nodeViewPortalProviderAPI.render(function () {
92
- return /*#__PURE__*/React.createElement(PanelIcon, {
93
- pluginInjectionApi: api,
94
- allowCustomPanel: pluginOptions.allowCustomPanel,
95
- panelAttributes: node.attrs,
96
- providerFactory: _this.providerFactory
97
- });
98
- }, this.icon, this.key);
99
- } else {
100
- ReactDOM.render( /*#__PURE__*/React.createElement(PanelIcon, {
91
+ this.nodeViewPortalProviderAPI.render(function () {
92
+ return /*#__PURE__*/React.createElement(PanelIcon, {
101
93
  pluginInjectionApi: api,
102
94
  allowCustomPanel: pluginOptions.allowCustomPanel,
103
95
  panelAttributes: node.attrs,
104
- providerFactory: this.providerFactory
105
- }), this.icon);
106
- }
96
+ providerFactory: _this.providerFactory
97
+ });
98
+ }, this.icon, this.key);
107
99
  }
108
100
  return _createClass(PanelNodeView, [{
109
101
  key: "ignoreMutation",
@@ -120,9 +112,7 @@ var PanelNodeView = /*#__PURE__*/function () {
120
112
  }, {
121
113
  key: "destroy",
122
114
  value: function destroy() {
123
- if (fg('platform_editor_react18_plugin_portalprovider')) {
124
- this.nodeViewPortalProviderAPI.remove(this.key);
125
- }
115
+ this.nodeViewPortalProviderAPI.remove(this.key);
126
116
  }
127
117
  }]);
128
118
  }();
@@ -22,7 +22,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
22
22
  import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
23
23
  import LegacySuccessIcon from '@atlaskit/icon/glyph/editor/success';
24
24
  import LegacyWarningIcon from '@atlaskit/icon/glyph/editor/warning';
25
- import { fg } from '@atlaskit/platform-feature-flags';
26
25
  import { changePanelType, removePanel } from '../editor-actions/actions';
27
26
  import { findPanel } from '../pm-plugins/utils/utils';
28
27
  export var panelIconMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, PanelType.INFO, {
@@ -239,7 +238,6 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
239
238
  });
240
239
  items.push({
241
240
  type: 'copy-button',
242
- supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
243
241
  items: [{
244
242
  state: state,
245
243
  formatMessage: formatMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,19 +31,19 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^99.10.0",
34
+ "@atlaskit/adf-schema": "^47.2.1",
35
+ "@atlaskit/editor-common": "^99.17.0",
36
36
  "@atlaskit/editor-palette": "1.7.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.12.0",
38
38
  "@atlaskit/editor-plugin-decorations": "^1.5.0",
39
39
  "@atlaskit/editor-plugin-emoji": "^2.9.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
- "@atlaskit/editor-shared-styles": "^3.2.0",
42
- "@atlaskit/emoji": "^67.13.0",
43
- "@atlaskit/icon": "^23.7.0",
44
- "@atlaskit/platform-feature-flags": "^1.0.0",
45
- "@atlaskit/theme": "^15.0.0",
46
- "@atlaskit/tmp-editor-statsig": "^2.43.0",
41
+ "@atlaskit/editor-shared-styles": "^3.3.0",
42
+ "@atlaskit/emoji": "^67.14.0",
43
+ "@atlaskit/icon": "^23.9.0",
44
+ "@atlaskit/platform-feature-flags": "^1.1.0",
45
+ "@atlaskit/theme": "^16.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^2.46.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "uuid": "^3.1.0"
49
49
  },
@@ -92,7 +92,7 @@
92
92
  }
93
93
  },
94
94
  "platform-feature-flags": {
95
- "platform_editor_remove_copy_button_from_view_mode": {
95
+ "platform_editor_update_panel_icon_aria_label": {
96
96
  "type": "boolean"
97
97
  },
98
98
  "platform_editor_react18_plugin_portalprovider": {