@atlaskit/editor-common 84.4.2 → 84.5.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,17 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 84.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#119314](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119314)
8
+ [`e7b05702b37eb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e7b05702b37eb) -
9
+ Include session id in the activity join/ack data
10
+ - [#119163](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119163)
11
+ [`45ae1b9a97c16`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/45ae1b9a97c16) -
12
+ [ux] Added onDropdownChange prop to overlay in editor-common. Used this prop to keep link
13
+ configure overlay open when dropdown is open, and hide overlay when dropdown is hidden.
14
+
3
15
  ## 84.4.2
4
16
 
5
17
  ### Patch Changes
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _react = require("@emotion/react");
11
+ var _react = require("react");
12
+ var _react2 = require("@emotion/react");
12
13
  var _reactIntlNext = require("react-intl-next");
13
14
  var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
14
15
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
@@ -22,32 +23,38 @@ var _excluded = ["triggerRef"];
22
23
  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); }
23
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
25
  var Dropdown = function Dropdown(_ref) {
25
- var testId = _ref.testId;
26
+ var testId = _ref.testId,
27
+ onDropdownChange = _ref.onDropdownChange;
26
28
  var _useIntl = (0, _reactIntlNext.useIntl)(),
27
29
  formatMessage = _useIntl.formatMessage;
28
30
  var configureLinkLabel = formatMessage(_messages.cardMessages.inlineConfigureLink);
29
31
  var goToLinkLabel = formatMessage(_messages.cardMessages.inlineGoToLink);
30
- return (0, _react.jsx)(_dropdownMenu.default, {
31
- trigger: function trigger(_ref2) {
32
- var triggerRef = _ref2.triggerRef,
33
- props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
34
- return (0, _react.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
32
+ var onOpenChange = (0, _react.useCallback)(function (_ref2) {
33
+ var isOpen = _ref2.isOpen;
34
+ onDropdownChange === null || onDropdownChange === void 0 || onDropdownChange(isOpen);
35
+ }, [onDropdownChange]);
36
+ return (0, _react2.jsx)(_dropdownMenu.default, {
37
+ trigger: function trigger(_ref3) {
38
+ var triggerRef = _ref3.triggerRef,
39
+ props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
40
+ return (0, _react2.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
35
41
  innerRef: triggerRef
36
42
  }, props, {
37
- iconBefore: (0, _react.jsx)(_chevronDown.default, {
43
+ iconBefore: (0, _react2.jsx)(_chevronDown.default, {
38
44
  label: configureLinkLabel,
39
45
  size: 'small'
40
46
  })
41
47
  }));
42
48
  },
43
- testId: "".concat(testId, "-dropdown")
44
- }, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react.jsx)(_dropdownMenu.DropdownItem, {
45
- elemBefore: (0, _react.jsx)(_shortcut.default, {
49
+ testId: "".concat(testId, "-dropdown"),
50
+ onOpenChange: onOpenChange
51
+ }, (0, _react2.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
52
+ elemBefore: (0, _react2.jsx)(_shortcut.default, {
46
53
  label: goToLinkLabel,
47
54
  size: 'medium'
48
55
  })
49
- }, goToLinkLabel), (0, _react.jsx)(_dropdownMenu.DropdownItem, {
50
- elemBefore: (0, _react.jsx)(_preferences.default, {
56
+ }, goToLinkLabel), (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
57
+ elemBefore: (0, _react2.jsx)(_preferences.default, {
51
58
  label: configureLinkLabel,
52
59
  size: 'medium'
53
60
  })
@@ -37,7 +37,8 @@ var OverlayButton = exports.OverlayButton = function OverlayButton(_ref) {
37
37
  _ref$testId = _ref.testId,
38
38
  testId = _ref$testId === void 0 ? 'link-configure-overlay-button' : _ref$testId,
39
39
  _ref$targetElementPos = _ref.targetElementPos,
40
- targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos;
40
+ targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos,
41
+ onDropdownChange = _ref.onDropdownChange;
41
42
  var _useIntl = (0, _reactIntlNext.useIntl)(),
42
43
  formatMessage = _useIntl.formatMessage;
43
44
  var configureLinkLabel = formatMessage(_messages.cardMessages.inlineConfigureLink);
@@ -82,7 +83,8 @@ var OverlayButton = exports.OverlayButton = function OverlayButton(_ref) {
82
83
  css: buttonWrapperStyles,
83
84
  "data-testid": testId
84
85
  }, showDropdown ? (0, _react2.jsx)(_Dropdown.default, {
85
- testId: testId
86
+ testId: testId,
87
+ onDropdownChange: onDropdownChange
86
88
  }) : (0, _react2.jsx)(_tooltip.default, {
87
89
  content: configureLinkLabel,
88
90
  hideTooltipOnClick: true,
@@ -11,6 +11,7 @@ var LinkAction = exports.LinkAction = /*#__PURE__*/function (LinkAction) {
11
11
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
12
12
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
13
13
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
14
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
14
15
  return LinkAction;
15
16
  }({});
16
17
  var InsertStatus = exports.InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "84.4.2";
20
+ var packageVersion = "84.5.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "84.4.2";
23
+ var packageVersion = "84.5.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -1,5 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
+ import { useCallback } from 'react';
4
+
3
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { jsx } from '@emotion/react';
5
7
  import { useIntl } from 'react-intl-next';
@@ -10,13 +12,19 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
10
12
  import { cardMessages as messages } from '../../messages';
11
13
  import { StyledButton } from './StyledButton';
12
14
  const Dropdown = ({
13
- testId
15
+ testId,
16
+ onDropdownChange
14
17
  }) => {
15
18
  const {
16
19
  formatMessage
17
20
  } = useIntl();
18
21
  const configureLinkLabel = formatMessage(messages.inlineConfigureLink);
19
22
  const goToLinkLabel = formatMessage(messages.inlineGoToLink);
23
+ const onOpenChange = useCallback(({
24
+ isOpen
25
+ }) => {
26
+ onDropdownChange === null || onDropdownChange === void 0 ? void 0 : onDropdownChange(isOpen);
27
+ }, [onDropdownChange]);
20
28
  return jsx(DropdownMenu, {
21
29
  trigger: ({
22
30
  triggerRef,
@@ -29,7 +37,8 @@ const Dropdown = ({
29
37
  size: 'small'
30
38
  })
31
39
  })),
32
- testId: `${testId}-dropdown`
40
+ testId: `${testId}-dropdown`,
41
+ onOpenChange: onOpenChange
33
42
  }, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
34
43
  elemBefore: jsx(ShortcutIcon, {
35
44
  label: goToLinkLabel,
@@ -25,7 +25,8 @@ const showDropdownThresholdPx = 50;
25
25
  export const OverlayButton = ({
26
26
  editorView,
27
27
  testId = 'link-configure-overlay-button',
28
- targetElementPos = 0
28
+ targetElementPos = 0,
29
+ onDropdownChange
29
30
  }) => {
30
31
  var _docNode$nodeSize;
31
32
  const {
@@ -72,7 +73,8 @@ export const OverlayButton = ({
72
73
  css: buttonWrapperStyles,
73
74
  "data-testid": testId
74
75
  }, showDropdown ? jsx(Dropdown, {
75
- testId: testId
76
+ testId: testId,
77
+ onDropdownChange: onDropdownChange
76
78
  }) : jsx(Tooltip, {
77
79
  content: configureLinkLabel,
78
80
  hideTooltipOnClick: true,
@@ -5,6 +5,7 @@ export let LinkAction = /*#__PURE__*/function (LinkAction) {
5
5
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
6
6
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
7
7
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
8
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
8
9
  return LinkAction;
9
10
  }({});
10
11
  export let InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "84.4.2";
4
+ const packageVersion = "84.5.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -9,7 +9,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
9
9
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "84.4.2";
12
+ const packageVersion = "84.5.0";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["triggerRef"];
4
4
  /** @jsx jsx */
5
+ import { useCallback } from 'react';
6
+
5
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
8
  import { jsx } from '@emotion/react';
7
9
  import { useIntl } from 'react-intl-next';
@@ -12,15 +14,20 @@ import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
12
14
  import { cardMessages as messages } from '../../messages';
13
15
  import { StyledButton } from './StyledButton';
14
16
  var Dropdown = function Dropdown(_ref) {
15
- var testId = _ref.testId;
17
+ var testId = _ref.testId,
18
+ onDropdownChange = _ref.onDropdownChange;
16
19
  var _useIntl = useIntl(),
17
20
  formatMessage = _useIntl.formatMessage;
18
21
  var configureLinkLabel = formatMessage(messages.inlineConfigureLink);
19
22
  var goToLinkLabel = formatMessage(messages.inlineGoToLink);
23
+ var onOpenChange = useCallback(function (_ref2) {
24
+ var isOpen = _ref2.isOpen;
25
+ onDropdownChange === null || onDropdownChange === void 0 || onDropdownChange(isOpen);
26
+ }, [onDropdownChange]);
20
27
  return jsx(DropdownMenu, {
21
- trigger: function trigger(_ref2) {
22
- var triggerRef = _ref2.triggerRef,
23
- props = _objectWithoutProperties(_ref2, _excluded);
28
+ trigger: function trigger(_ref3) {
29
+ var triggerRef = _ref3.triggerRef,
30
+ props = _objectWithoutProperties(_ref3, _excluded);
24
31
  return jsx(StyledButton, _extends({
25
32
  innerRef: triggerRef
26
33
  }, props, {
@@ -30,7 +37,8 @@ var Dropdown = function Dropdown(_ref) {
30
37
  })
31
38
  }));
32
39
  },
33
- testId: "".concat(testId, "-dropdown")
40
+ testId: "".concat(testId, "-dropdown"),
41
+ onOpenChange: onOpenChange
34
42
  }, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
35
43
  elemBefore: jsx(ShortcutIcon, {
36
44
  label: goToLinkLabel,
@@ -29,7 +29,8 @@ export var OverlayButton = function OverlayButton(_ref) {
29
29
  _ref$testId = _ref.testId,
30
30
  testId = _ref$testId === void 0 ? 'link-configure-overlay-button' : _ref$testId,
31
31
  _ref$targetElementPos = _ref.targetElementPos,
32
- targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos;
32
+ targetElementPos = _ref$targetElementPos === void 0 ? 0 : _ref$targetElementPos,
33
+ onDropdownChange = _ref.onDropdownChange;
33
34
  var _useIntl = useIntl(),
34
35
  formatMessage = _useIntl.formatMessage;
35
36
  var configureLinkLabel = formatMessage(cardMessages.inlineConfigureLink);
@@ -74,7 +75,8 @@ export var OverlayButton = function OverlayButton(_ref) {
74
75
  css: buttonWrapperStyles,
75
76
  "data-testid": testId
76
77
  }, showDropdown ? jsx(Dropdown, {
77
- testId: testId
78
+ testId: testId,
79
+ onDropdownChange: onDropdownChange
78
80
  }) : jsx(Tooltip, {
79
81
  content: configureLinkLabel,
80
82
  hideTooltipOnClick: true,
@@ -5,6 +5,7 @@ export var LinkAction = /*#__PURE__*/function (LinkAction) {
5
5
  LinkAction["INSERT_LINK_TOOLBAR"] = "INSERT";
6
6
  LinkAction["EDIT_INSERTED_TOOLBAR"] = "EDIT_INSERTED_TOOLBAR";
7
7
  LinkAction["SET_CONFIGURE_BUTTON_TARGET_POS"] = "SET_CONFIGURE_BUTTON_TARGET_POS";
8
+ LinkAction["SET_CONFIGURE_DROPDOWN_OPEN"] = "SET_CONFIGURE_DROPDOWN_OPEN";
8
9
  return LinkAction;
9
10
  }({});
10
11
  export var InsertStatus = /*#__PURE__*/function (InsertStatus) {
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "84.4.2";
10
+ var packageVersion = "84.5.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
17
17
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
18
18
  import Layer from '../Layer';
19
19
  var packageName = "@atlaskit/editor-common";
20
- var packageVersion = "84.4.2";
20
+ var packageVersion = "84.5.0";
21
21
  var halfFocusRing = 1;
22
22
  var dropOffset = '0, 8';
23
23
  var DropList = /*#__PURE__*/function (_Component) {
@@ -288,6 +288,7 @@ export interface CollabSendableSelection {
288
288
  export type Activity = 'VIEWING' | 'EDITING';
289
289
  export type CollabActivityData = {
290
290
  activity: Activity;
291
+ sessionId: string;
291
292
  userId?: string;
292
293
  };
293
294
  export type CollabActivityJoinPayload = CollabActivityData & {
@@ -1,7 +1,8 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
2
+ export type OnDropdownChange = (isOpen: boolean) => void;
3
3
  export type DropdownProps = {
4
4
  testId: string;
5
+ onDropdownChange?: OnDropdownChange;
5
6
  };
6
- declare const Dropdown: ({ testId }: DropdownProps) => jsx.JSX.Element;
7
+ declare const Dropdown: ({ testId, onDropdownChange }: DropdownProps) => jsx.JSX.Element;
7
8
  export default Dropdown;
@@ -1,8 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type OnDropdownChange } from './Dropdown';
3
4
  export interface OverlayButtonProps {
4
5
  editorView: EditorView;
5
6
  testId?: string;
6
7
  targetElementPos?: number;
8
+ /**
9
+ * Called when the dropdown is open/closed with isOpen state as true and false respectively.
10
+ */
11
+ onDropdownChange?: OnDropdownChange;
7
12
  }
8
- export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
13
+ export declare const OverlayButton: ({ editorView, testId, targetElementPos, onDropdownChange, }: OverlayButtonProps) => jsx.JSX.Element | null;
@@ -8,7 +8,8 @@ export declare enum LinkAction {
8
8
  SELECTION_CHANGE = "SELECTION_CHANGE",
9
9
  INSERT_LINK_TOOLBAR = "INSERT",
10
10
  EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
11
- SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
11
+ SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS",
12
+ SET_CONFIGURE_DROPDOWN_OPEN = "SET_CONFIGURE_DROPDOWN_OPEN"
12
13
  }
13
14
  export declare enum InsertStatus {
14
15
  EDIT_LINK_TOOLBAR = "EDIT",
@@ -41,4 +42,5 @@ export interface HyperlinkState {
41
42
  editorAppearance?: EditorAppearance;
42
43
  configureButtonTargetPos?: number;
43
44
  decorations?: DecorationSet;
45
+ configureDropdownOpen?: boolean;
44
46
  }
@@ -288,6 +288,7 @@ export interface CollabSendableSelection {
288
288
  export type Activity = 'VIEWING' | 'EDITING';
289
289
  export type CollabActivityData = {
290
290
  activity: Activity;
291
+ sessionId: string;
291
292
  userId?: string;
292
293
  };
293
294
  export type CollabActivityJoinPayload = CollabActivityData & {
@@ -1,7 +1,8 @@
1
- /** @jsx jsx */
2
1
  import { jsx } from '@emotion/react';
2
+ export type OnDropdownChange = (isOpen: boolean) => void;
3
3
  export type DropdownProps = {
4
4
  testId: string;
5
+ onDropdownChange?: OnDropdownChange;
5
6
  };
6
- declare const Dropdown: ({ testId }: DropdownProps) => jsx.JSX.Element;
7
+ declare const Dropdown: ({ testId, onDropdownChange }: DropdownProps) => jsx.JSX.Element;
7
8
  export default Dropdown;
@@ -1,8 +1,13 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import { type OnDropdownChange } from './Dropdown';
3
4
  export interface OverlayButtonProps {
4
5
  editorView: EditorView;
5
6
  testId?: string;
6
7
  targetElementPos?: number;
8
+ /**
9
+ * Called when the dropdown is open/closed with isOpen state as true and false respectively.
10
+ */
11
+ onDropdownChange?: OnDropdownChange;
7
12
  }
8
- export declare const OverlayButton: ({ editorView, testId, targetElementPos, }: OverlayButtonProps) => jsx.JSX.Element | null;
13
+ export declare const OverlayButton: ({ editorView, testId, targetElementPos, onDropdownChange, }: OverlayButtonProps) => jsx.JSX.Element | null;
@@ -8,7 +8,8 @@ export declare enum LinkAction {
8
8
  SELECTION_CHANGE = "SELECTION_CHANGE",
9
9
  INSERT_LINK_TOOLBAR = "INSERT",
10
10
  EDIT_INSERTED_TOOLBAR = "EDIT_INSERTED_TOOLBAR",
11
- SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS"
11
+ SET_CONFIGURE_BUTTON_TARGET_POS = "SET_CONFIGURE_BUTTON_TARGET_POS",
12
+ SET_CONFIGURE_DROPDOWN_OPEN = "SET_CONFIGURE_DROPDOWN_OPEN"
12
13
  }
13
14
  export declare enum InsertStatus {
14
15
  EDIT_LINK_TOOLBAR = "EDIT",
@@ -41,4 +42,5 @@ export interface HyperlinkState {
41
42
  editorAppearance?: EditorAppearance;
42
43
  configureButtonTargetPos?: number;
43
44
  decorations?: DecorationSet;
45
+ configureDropdownOpen?: boolean;
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "84.4.2",
3
+ "version": "84.5.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"