@atlaskit/editor-plugin-extension 2.0.0 → 2.0.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,23 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#169955](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169955)
8
+ [`3c2ffc27c518e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3c2ffc27c518e) -
9
+ ED-25863 add logic to stop the LCM inner editor losing focus. Tweak blur logic for extension to
10
+ fully remove current selection when clicking into the LCM.
11
+
12
+ ## 2.0.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#173426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/173426)
17
+ [`2ce125017f62d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ce125017f62d) -
18
+ cleanup platform_editor_react18_phase2_loadable
19
+ - Updated dependencies
20
+
3
21
  ## 2.0.0
4
22
 
5
23
  ### Major Changes
@@ -234,10 +234,9 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
234
234
  if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro')) {
235
235
  var currentTarget = event.relatedTarget;
236
236
  var source = event.target;
237
- var selection = view.state.selection;
238
237
 
239
- // If the focus is going from outside to inside an area designated as an editable area of an extension, and an extension is the current selection, then the extension selection is reset.
240
- if (selection instanceof _state.NodeSelection && selection.node.type === view.state.schema.nodes.extension && currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
238
+ // If the focus is going from outside to inside an area designated as an editable area of an extension, then the extension selection is reset.
239
+ if (currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
241
240
  var emptySelection = new _state.TextSelection(view.state.doc.resolve(0));
242
241
  var tr = view.state.tr.setSelection(emptySelection);
243
242
  view.dispatch(tr);
@@ -8,12 +8,10 @@ exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _reactIntlNext = require("react-intl-next");
11
- var _reactLoadable = _interopRequireDefault(require("react-loadable"));
12
11
  var _new = require("@atlaskit/button/new");
13
12
  var _extensions = require("@atlaskit/editor-common/extensions");
14
13
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
15
14
  var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
15
  var _primitives = require("@atlaskit/primitives");
18
16
  var _colors = require("@atlaskit/theme/colors");
19
17
  var _constants = require("@atlaskit/theme/constants");
@@ -99,23 +97,15 @@ var Header = function Header(_ref) {
99
97
  onClose = _ref.onClose,
100
98
  intl = _ref.intl;
101
99
  var ResolvedIcon = (0, _react.useMemo)(function () {
102
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2_loadable')) {
103
- return /*#__PURE__*/(0, _react.lazy)(function () {
104
- return icon().then(function (Cmp) {
105
- if ('default' in Cmp) {
106
- return Cmp;
107
- }
108
- return {
109
- default: Cmp
110
- };
111
- });
100
+ return /*#__PURE__*/(0, _react.lazy)(function () {
101
+ return icon().then(function (Cmp) {
102
+ if ('default' in Cmp) {
103
+ return Cmp;
104
+ }
105
+ return {
106
+ default: Cmp
107
+ };
112
108
  });
113
- }
114
- return (0, _reactLoadable.default)({
115
- loader: icon,
116
- loading: function loading() {
117
- return null;
118
- }
119
109
  });
120
110
  }, [icon]);
121
111
  return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)("div", {
@@ -158,10 +158,9 @@ const createPlugin = (dispatch, providerFactory, extensionHandlers, portalProvid
158
158
  if (fg('platform_editor_legacy_content_macro')) {
159
159
  const currentTarget = event.relatedTarget;
160
160
  const source = event.target;
161
- const selection = view.state.selection;
162
161
 
163
- // If the focus is going from outside to inside an area designated as an editable area of an extension, and an extension is the current selection, then the extension selection is reset.
164
- if (selection instanceof NodeSelection && selection.node.type === view.state.schema.nodes.extension && currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
162
+ // If the focus is going from outside to inside an area designated as an editable area of an extension, then the extension selection is reset.
163
+ if (currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
165
164
  const emptySelection = new TextSelection(view.state.doc.resolve(0));
166
165
  const tr = view.state.tr.setSelection(emptySelection);
167
166
  view.dispatch(tr);
@@ -7,12 +7,10 @@ import { Fragment, lazy, Suspense, useMemo } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { injectIntl } from 'react-intl-next';
10
- import Loadable from 'react-loadable';
11
10
  import { IconButton } from '@atlaskit/button/new';
12
11
  import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
13
12
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
13
  import CrossIcon from '@atlaskit/icon/glyph/cross';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
14
  import { Box, Text, xcss } from '@atlaskit/primitives';
17
15
  import { N200 } from '@atlaskit/theme/colors';
18
16
  import { borderRadius } from '@atlaskit/theme/constants';
@@ -92,20 +90,14 @@ const Header = ({
92
90
  intl
93
91
  }) => {
94
92
  const ResolvedIcon = useMemo(() => {
95
- if (fg('platform_editor_react18_phase2_loadable')) {
96
- return /*#__PURE__*/lazy(() => icon().then(Cmp => {
97
- if ('default' in Cmp) {
98
- return Cmp;
99
- }
100
- return {
101
- default: Cmp
102
- };
103
- }));
104
- }
105
- return Loadable({
106
- loader: icon,
107
- loading: () => null
108
- });
93
+ return /*#__PURE__*/lazy(() => icon().then(Cmp => {
94
+ if ('default' in Cmp) {
95
+ return Cmp;
96
+ }
97
+ return {
98
+ default: Cmp
99
+ };
100
+ }));
109
101
  }, [icon]);
110
102
  return jsx(Fragment, null, jsx("div", {
111
103
  css: itemStyles
@@ -208,10 +208,9 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
208
208
  if (fg('platform_editor_legacy_content_macro')) {
209
209
  var currentTarget = event.relatedTarget;
210
210
  var source = event.target;
211
- var selection = view.state.selection;
212
211
 
213
- // If the focus is going from outside to inside an area designated as an editable area of an extension, and an extension is the current selection, then the extension selection is reset.
214
- if (selection instanceof NodeSelection && selection.node.type === view.state.schema.nodes.extension && currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
212
+ // If the focus is going from outside to inside an area designated as an editable area of an extension, then the extension selection is reset.
213
+ if (currentTarget.closest('.extension-editable-area') && !source.closest('.extension-editable-area')) {
215
214
  var emptySelection = new TextSelection(view.state.doc.resolve(0));
216
215
  var tr = view.state.tr.setSelection(emptySelection);
217
216
  view.dispatch(tr);
@@ -7,12 +7,10 @@ import { Fragment, lazy, Suspense, useMemo } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { injectIntl } from 'react-intl-next';
10
- import Loadable from 'react-loadable';
11
10
  import { IconButton } from '@atlaskit/button/new';
12
11
  import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
13
12
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
13
  import CrossIcon from '@atlaskit/icon/glyph/cross';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
14
  import { Box, Text, xcss } from '@atlaskit/primitives';
17
15
  import { N200 } from '@atlaskit/theme/colors';
18
16
  import { borderRadius } from '@atlaskit/theme/constants';
@@ -91,23 +89,15 @@ var Header = function Header(_ref) {
91
89
  onClose = _ref.onClose,
92
90
  intl = _ref.intl;
93
91
  var ResolvedIcon = useMemo(function () {
94
- if (fg('platform_editor_react18_phase2_loadable')) {
95
- return /*#__PURE__*/lazy(function () {
96
- return icon().then(function (Cmp) {
97
- if ('default' in Cmp) {
98
- return Cmp;
99
- }
100
- return {
101
- default: Cmp
102
- };
103
- });
92
+ return /*#__PURE__*/lazy(function () {
93
+ return icon().then(function (Cmp) {
94
+ if ('default' in Cmp) {
95
+ return Cmp;
96
+ }
97
+ return {
98
+ default: Cmp
99
+ };
104
100
  });
105
- }
106
- return Loadable({
107
- loader: icon,
108
- loading: function loading() {
109
- return null;
110
- }
111
101
  });
112
102
  }, [icon]);
113
103
  return jsx(Fragment, null, jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "@atlaskit/button": "^20.3.0",
31
31
  "@atlaskit/checkbox": "^15.2.0",
32
32
  "@atlaskit/datetime-picker": "^15.9.0",
33
- "@atlaskit/editor-common": "^96.0.0",
33
+ "@atlaskit/editor-common": "^96.2.0",
34
34
  "@atlaskit/editor-json-transformer": "^8.21.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
36
36
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
@@ -49,14 +49,14 @@
49
49
  "@atlaskit/primitives": "^13.3.0",
50
50
  "@atlaskit/radio": "^6.6.0",
51
51
  "@atlaskit/section-message": "^6.8.0",
52
- "@atlaskit/select": "^18.7.0",
52
+ "@atlaskit/select": "^18.8.0",
53
53
  "@atlaskit/smart-user-picker": "^6.11.0",
54
54
  "@atlaskit/spinner": "^16.3.0",
55
- "@atlaskit/tabs": "^16.5.0",
56
- "@atlaskit/textarea": "^5.6.0",
57
- "@atlaskit/textfield": "^6.6.0",
55
+ "@atlaskit/tabs": "^17.0.0",
56
+ "@atlaskit/textarea": "^5.7.0",
57
+ "@atlaskit/textfield": "^6.7.0",
58
58
  "@atlaskit/theme": "^14.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^2.22.0",
59
+ "@atlaskit/tmp-editor-statsig": "^2.23.0",
60
60
  "@atlaskit/toggle": "^13.4.0",
61
61
  "@atlaskit/tokens": "^2.4.0",
62
62
  "@atlaskit/tooltip": "^18.9.0",
@@ -112,9 +112,6 @@
112
112
  },
113
113
  "platform_editor_legacy_content_macro": {
114
114
  "type": "boolean"
115
- },
116
- "platform_editor_react18_phase2_loadable": {
117
- "type": "boolean"
118
115
  }
119
116
  },
120
117
  "stricter": {