@atlaskit/editor-plugin-block-menu 15.1.2 → 15.1.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,13 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 15.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`95de7cb0e5f70`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/95de7cb0e5f70) -
8
+ Revert position calculation for block menu popup
9
+ - Updated dependencies
10
+
3
11
  ## 15.1.2
4
12
 
5
13
  ### Patch Changes
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
9
9
  exports.default = void 0;
10
10
  require("./block-menu.compiled.css");
11
11
  var _runtime = require("@compiled/react/runtime");
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
14
13
  var _react = _interopRequireWildcard(require("react"));
15
14
  var _reactIntl = require("react-intl");
@@ -34,8 +33,6 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
34
33
  var _blockMenuProvider = require("./block-menu-provider");
35
34
  var _BlockMenuRenderer = require("./block-menu-renderer/BlockMenuRenderer");
36
35
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
37
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
38
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
39
36
  var styles = {
40
37
  base: "_2rko12b0 _bfhk1bhr _16qs130s",
41
38
  maxWidthStyles: "_p12fnklw",
@@ -360,23 +357,6 @@ var BlockMenu = function BlockMenu(_ref5) {
360
357
  stick: true
361
358
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
362
359
  ,
363
- onPositionCalculated: (0, _fg.fg)('platform_editor_blocks_patch_8') ? function (position) {
364
- if (position.left === undefined) {
365
- // Already placed on the gutter side (using `right`) - nothing to correct.
366
- return position;
367
- }
368
- // Popup prefers whichever side has more room, which flips the menu onto the
369
- // content side when the gutter is too narrow to fit it. Force it back onto the
370
- // gutter side instead - it can still overlap the content once there, but it
371
- // must not start on top of the node. `position.left` is shifted by the same
372
- // distance regardless of the offset parent/scroll it was calculated against,
373
- // since that just moves both by the same amount.
374
- return _objectSpread(_objectSpread({}, position), {}, {
375
- left: position.left - DEFAULT_MENU_WIDTH - _styles.DRAG_HANDLE_WIDTH - 2 * DRAG_HANDLE_OFFSET_PADDING
376
- });
377
- } : undefined
378
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
379
- ,
380
360
  offset: [_styles.DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, targetHandleHeightOffset],
381
361
  focusTrap: openedViaKeyboard ?
382
362
  // Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
@@ -340,24 +340,6 @@ const BlockMenu = ({
340
340
  stick: true
341
341
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
342
342
  ,
343
- onPositionCalculated: fg('platform_editor_blocks_patch_8') ? position => {
344
- if (position.left === undefined) {
345
- // Already placed on the gutter side (using `right`) - nothing to correct.
346
- return position;
347
- }
348
- // Popup prefers whichever side has more room, which flips the menu onto the
349
- // content side when the gutter is too narrow to fit it. Force it back onto the
350
- // gutter side instead - it can still overlap the content once there, but it
351
- // must not start on top of the node. `position.left` is shifted by the same
352
- // distance regardless of the offset parent/scroll it was calculated against,
353
- // since that just moves both by the same amount.
354
- return {
355
- ...position,
356
- left: position.left - DEFAULT_MENU_WIDTH - DRAG_HANDLE_WIDTH - 2 * DRAG_HANDLE_OFFSET_PADDING
357
- };
358
- } : undefined
359
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
360
- ,
361
343
  offset: [DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, targetHandleHeightOffset],
362
344
  focusTrap: openedViaKeyboard ?
363
345
  // Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
@@ -1,10 +1,7 @@
1
1
  /* block-menu.tsx generated by @compiled/babel-plugin v2.0.0 */
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
3
  import "./block-menu.compiled.css";
5
4
  import { ax, ix } from "@compiled/react/runtime";
6
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
5
  import React, { useContext, useEffect, useRef } from 'react';
9
6
  import { injectIntl } from 'react-intl';
10
7
  import { cx } from '@atlaskit/css';
@@ -351,23 +348,6 @@ var BlockMenu = function BlockMenu(_ref5) {
351
348
  stick: true
352
349
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
353
350
  ,
354
- onPositionCalculated: fg('platform_editor_blocks_patch_8') ? function (position) {
355
- if (position.left === undefined) {
356
- // Already placed on the gutter side (using `right`) - nothing to correct.
357
- return position;
358
- }
359
- // Popup prefers whichever side has more room, which flips the menu onto the
360
- // content side when the gutter is too narrow to fit it. Force it back onto the
361
- // gutter side instead - it can still overlap the content once there, but it
362
- // must not start on top of the node. `position.left` is shifted by the same
363
- // distance regardless of the offset parent/scroll it was calculated against,
364
- // since that just moves both by the same amount.
365
- return _objectSpread(_objectSpread({}, position), {}, {
366
- left: position.left - DEFAULT_MENU_WIDTH - DRAG_HANDLE_WIDTH - 2 * DRAG_HANDLE_OFFSET_PADDING
367
- });
368
- } : undefined
369
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
370
- ,
371
351
  offset: [DRAG_HANDLE_WIDTH + DRAG_HANDLE_OFFSET_PADDING, targetHandleHeightOffset],
372
352
  focusTrap: openedViaKeyboard ?
373
353
  // Only enable focus trap when opened via keyboard to make sure the focus is on the first focusable menu item
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "15.1.2",
3
+ "version": "15.1.3",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  "memoize-one": "^6.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@atlaskit/editor-common": "^120.12.0",
47
+ "@atlaskit/editor-common": "^120.13.0",
48
48
  "react": "^18.2.0 || ^19.2.0",
49
49
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
50
50
  },