@atlaskit/editor-plugin-insert-block 2.4.2 → 2.4.3

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,15 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#155668](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155668)
8
+ [`f948f63ced742`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f948f63ced742) -
9
+ We are testing replacing findDOMNode with an explicit ref behind a feature flag. If this fix is
10
+ successful it will be available in a later release.
11
+ - Updated dependencies
12
+
3
13
  ## 2.4.2
4
14
 
5
15
  ### Patch Changes
@@ -230,9 +230,11 @@ var flexWrapperStyles = (0, _react2.css)({
230
230
  overflow: 'hidden'
231
231
  });
232
232
  var FlexWrapper = function FlexWrapper(props) {
233
+ var setOutsideClickTargetRef = (0, _react.useContext)(_uiReact.OutsideClickTargetRefContext);
233
234
  var children = props.children,
234
235
  divProps = (0, _objectWithoutProperties2.default)(props, _excluded);
235
236
  return (0, _react2.jsx)("div", (0, _extends2.default)({
237
+ ref: setOutsideClickTargetRef,
236
238
  css: flexWrapperStyles
237
239
  }, divProps), children);
238
240
  };
@@ -15,6 +15,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
15
15
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
18
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
18
19
  var _react = _interopRequireDefault(require("react"));
19
20
  var _react2 = require("@emotion/react");
20
21
  var _reactIntlNext = require("react-intl-next");
@@ -53,13 +54,19 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
53
54
  var isDetachedElement = function isDetachedElement(el) {
54
55
  return !document.body.contains(el);
55
56
  };
56
- var EmojiPickerWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_picker.EmojiPicker);
57
57
  var TABLE_SELECTOR_STRING = 'table selector';
58
58
 
59
59
  // TODO: Jenga team will create a component for a split button using this css
60
60
  var getHoverStyles = function getHoverStyles(selector) {
61
61
  return "&:hover ".concat(selector, " {\n background: ", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N20A, ")"), ";\n\n &:hover {\n background: ", "var(--ds-background-neutral-hovered, ".concat(colors.N30A, ")"), ";\n }\n }");
62
62
  };
63
+ var EmojiPicker = function EmojiPicker(props) {
64
+ var setOutsideClickTargetRef = _react.default.useContext(_uiReact.OutsideClickTargetRefContext);
65
+ return (0, _react2.jsx)(_picker.EmojiPicker, (0, _extends2.default)({
66
+ onPickerRef: setOutsideClickTargetRef
67
+ }, props));
68
+ };
69
+ var EmojiPickerWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(EmojiPicker);
63
70
  var tableButtonWrapper = exports.tableButtonWrapper = function tableButtonWrapper(_ref) {
64
71
  var isTableSelectorOpen = _ref.isTableSelectorOpen,
65
72
  isButtonDisabled = _ref.isButtonDisabled;
@@ -8,6 +8,7 @@ var _react = require("react");
8
8
  var _react2 = require("@emotion/react");
9
9
  var _reactIntlNext = require("react-intl-next");
10
10
  var _messages = require("@atlaskit/editor-common/messages");
11
+ var _uiReact = require("@atlaskit/editor-common/ui-react");
11
12
  var _primitives = require("@atlaskit/primitives");
12
13
  var _colors = require("@atlaskit/theme/colors");
13
14
  /**
@@ -115,7 +116,10 @@ var TableSelectorPopup = function TableSelectorPopup(_ref3) {
115
116
  var buttons = (0, _react.useMemo)(function () {
116
117
  return createArray(maxCols, maxRows);
117
118
  }, [maxCols, maxRows]);
118
- return (0, _react2.jsx)(_primitives.Stack, null, (0, _react2.jsx)("div", {
119
+ var setOutsideClickTargetRef = (0, _react.useContext)(_uiReact.OutsideClickTargetRefContext);
120
+ return (0, _react2.jsx)(_primitives.Stack, {
121
+ ref: setOutsideClickTargetRef
122
+ }, (0, _react2.jsx)("div", {
119
123
  "aria-label": "".concat(formatMessage(_messages.toolbarInsertBlockMessages.tableSizeSelectorPopup)),
120
124
  css:
121
125
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
@@ -4,14 +4,14 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
 
7
- import { useCallback, useState } from 'react';
7
+ import { useCallback, useContext, useState } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
12
12
  import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
13
13
  import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
14
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
14
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
15
15
  // AFP-2532 TODO: Fix automatic suppressions below
16
16
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
17
17
  import { borderRadius } from '@atlaskit/theme';
@@ -217,11 +217,13 @@ const flexWrapperStyles = css({
217
217
  overflow: 'hidden'
218
218
  });
219
219
  const FlexWrapper = props => {
220
+ const setOutsideClickTargetRef = useContext(OutsideClickTargetRefContext);
220
221
  const {
221
222
  children,
222
223
  ...divProps
223
224
  } = props;
224
225
  return jsx("div", _extends({
226
+ ref: setOutsideClickTargetRef,
225
227
  css: flexWrapperStyles
226
228
  }, divProps), children);
227
229
  };
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  /**
3
4
  * @jsxRuntime classic
4
5
  * @jsx jsx
@@ -12,7 +13,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
12
13
  import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
13
14
  import { Popup } from '@atlaskit/editor-common/ui';
14
15
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
15
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
16
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
16
17
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
17
18
  import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
18
19
  import * as colors from '@atlaskit/theme/colors';
@@ -26,7 +27,6 @@ import TableSelectorPopup from './table-selector-popup-with-listeners';
26
27
  * Checks if an element is detached (i.e. not in the current document)
27
28
  */
28
29
  const isDetachedElement = el => !document.body.contains(el);
29
- const EmojiPickerWithListeners = withOuterListeners(AkEmojiPicker);
30
30
  const TABLE_SELECTOR_STRING = 'table selector';
31
31
 
32
32
  // TODO: Jenga team will create a component for a split button using this css
@@ -37,6 +37,13 @@ const getHoverStyles = selector => `&:hover ${selector} {
37
37
  background: ${`var(--ds-background-neutral-hovered, ${colors.N30A})`};
38
38
  }
39
39
  }`;
40
+ const EmojiPicker = props => {
41
+ const setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
42
+ return jsx(AkEmojiPicker, _extends({
43
+ onPickerRef: setOutsideClickTargetRef
44
+ }, props));
45
+ };
46
+ const EmojiPickerWithListeners = withOuterListeners(EmojiPicker);
40
47
  export const tableButtonWrapper = ({
41
48
  isTableSelectorOpen,
42
49
  isButtonDisabled
@@ -2,11 +2,12 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { useEffect, useMemo, useRef } from 'react';
5
+ import { useContext, useEffect, useMemo, useRef } from 'react';
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { injectIntl } from 'react-intl-next';
9
9
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
10
+ import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
10
11
  import { Stack } from '@atlaskit/primitives';
11
12
  import { B100 } from '@atlaskit/theme/colors';
12
13
  export const TABLE_SELECTOR_BUTTON_GAP = 2;
@@ -106,7 +107,10 @@ const TableSelectorPopup = ({
106
107
  const buttons = useMemo(() => {
107
108
  return createArray(maxCols, maxRows);
108
109
  }, [maxCols, maxRows]);
109
- return jsx(Stack, null, jsx("div", {
110
+ const setOutsideClickTargetRef = useContext(OutsideClickTargetRefContext);
111
+ return jsx(Stack, {
112
+ ref: setOutsideClickTargetRef
113
+ }, jsx("div", {
110
114
  "aria-label": `${formatMessage(messages.tableSizeSelectorPopup)}`,
111
115
  css:
112
116
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
@@ -8,14 +8,14 @@ var _excluded = ["children"];
8
8
  * @jsx jsx
9
9
  */
10
10
 
11
- import { useCallback, useState } from 'react';
11
+ import { useCallback, useContext, useState } from 'react';
12
12
 
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
14
  import { css, jsx } from '@emotion/react';
15
15
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
16
16
  import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
17
17
  import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
18
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
18
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
19
19
  // AFP-2532 TODO: Fix automatic suppressions below
20
20
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
21
21
  import { borderRadius } from '@atlaskit/theme';
@@ -225,9 +225,11 @@ var flexWrapperStyles = css({
225
225
  overflow: 'hidden'
226
226
  });
227
227
  var FlexWrapper = function FlexWrapper(props) {
228
+ var setOutsideClickTargetRef = useContext(OutsideClickTargetRefContext);
228
229
  var children = props.children,
229
230
  divProps = _objectWithoutProperties(props, _excluded);
230
231
  return jsx("div", _extends({
232
+ ref: setOutsideClickTargetRef,
231
233
  css: flexWrapperStyles
232
234
  }, divProps), children);
233
235
  };
@@ -7,6 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
+ import _extends from "@babel/runtime/helpers/extends";
10
11
  var _templateObject;
11
12
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
12
13
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -28,7 +29,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
28
29
  import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
29
30
  import { Popup } from '@atlaskit/editor-common/ui';
30
31
  import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
31
- import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
32
+ import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
32
33
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
33
34
  import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
34
35
  import * as colors from '@atlaskit/theme/colors';
@@ -44,13 +45,19 @@ import TableSelectorPopup from './table-selector-popup-with-listeners';
44
45
  var isDetachedElement = function isDetachedElement(el) {
45
46
  return !document.body.contains(el);
46
47
  };
47
- var EmojiPickerWithListeners = withOuterListeners(AkEmojiPicker);
48
48
  var TABLE_SELECTOR_STRING = 'table selector';
49
49
 
50
50
  // TODO: Jenga team will create a component for a split button using this css
51
51
  var getHoverStyles = function getHoverStyles(selector) {
52
52
  return "&:hover ".concat(selector, " {\n background: ", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N20A, ")"), ";\n\n &:hover {\n background: ", "var(--ds-background-neutral-hovered, ".concat(colors.N30A, ")"), ";\n }\n }");
53
53
  };
54
+ var EmojiPicker = function EmojiPicker(props) {
55
+ var setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
56
+ return jsx(AkEmojiPicker, _extends({
57
+ onPickerRef: setOutsideClickTargetRef
58
+ }, props));
59
+ };
60
+ var EmojiPickerWithListeners = withOuterListeners(EmojiPicker);
54
61
  export var tableButtonWrapper = function tableButtonWrapper(_ref) {
55
62
  var isTableSelectorOpen = _ref.isTableSelectorOpen,
56
63
  isButtonDisabled = _ref.isButtonDisabled;
@@ -2,11 +2,12 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { useEffect, useMemo, useRef } from 'react';
5
+ import { useContext, useEffect, useMemo, useRef } from 'react';
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { injectIntl } from 'react-intl-next';
9
9
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
10
+ import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
10
11
  import { Stack } from '@atlaskit/primitives';
11
12
  import { B100 } from '@atlaskit/theme/colors';
12
13
  export var TABLE_SELECTOR_BUTTON_GAP = 2;
@@ -107,7 +108,10 @@ var TableSelectorPopup = function TableSelectorPopup(_ref3) {
107
108
  var buttons = useMemo(function () {
108
109
  return createArray(maxCols, maxRows);
109
110
  }, [maxCols, maxRows]);
110
- return jsx(Stack, null, jsx("div", {
111
+ var setOutsideClickTargetRef = useContext(OutsideClickTargetRefContext);
112
+ return jsx(Stack, {
113
+ ref: setOutsideClickTargetRef
114
+ }, jsx("div", {
111
115
  "aria-label": "".concat(formatMessage(messages.tableSizeSelectorPopup)),
112
116
  css:
113
117
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.3.0",
35
- "@atlaskit/editor-common": "^94.3.0",
35
+ "@atlaskit/editor-common": "^94.5.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-block-type": "^3.16.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.5.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/editor-plugin-hyperlink": "^3.1.0",
45
45
  "@atlaskit/editor-plugin-image-upload": "^1.2.0",
46
46
  "@atlaskit/editor-plugin-layout": "^1.9.0",
47
- "@atlaskit/editor-plugin-media": "^1.37.0",
47
+ "@atlaskit/editor-plugin-media": "^1.38.0",
48
48
  "@atlaskit/editor-plugin-media-insert": "^3.2.0",
49
49
  "@atlaskit/editor-plugin-mentions": "^2.10.0",
50
50
  "@atlaskit/editor-plugin-panel": "^2.6.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/editor-plugin-tasks-and-decisions": "^2.11.0",
58
58
  "@atlaskit/editor-plugin-type-ahead": "^1.10.0",
59
59
  "@atlaskit/editor-prosemirror": "6.0.0",
60
- "@atlaskit/editor-shared-styles": "^3.0.0",
60
+ "@atlaskit/editor-shared-styles": "^3.1.0",
61
61
  "@atlaskit/emoji": "^67.8.0",
62
62
  "@atlaskit/heading": "2.4.6",
63
63
  "@atlaskit/icon": "^22.24.0",
@@ -65,7 +65,7 @@
65
65
  "@atlaskit/platform-feature-flags": "^0.3.0",
66
66
  "@atlaskit/primitives": "^12.2.0",
67
67
  "@atlaskit/theme": "^14.0.0",
68
- "@atlaskit/tmp-editor-statsig": "^2.9.0",
68
+ "@atlaskit/tmp-editor-statsig": "^2.10.0",
69
69
  "@atlaskit/tokens": "^2.0.0",
70
70
  "@atlaskit/tooltip": "18.8.5",
71
71
  "@babel/runtime": "^7.0.0",