@atlaskit/editor-common 75.7.1 → 75.8.1

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,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 75.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b1b8c7d356c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b1b8c7d356c) - [ED-19757] Fix getPos throwing exception for all nodeviews
8
+
9
+ ## 75.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`3aaff60be08`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3aaff60be08) - ED-18988 Adds classnames and constants for table sticky scrollbar
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 75.7.1
4
20
 
5
21
  ### Patch Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "75.7.1";
19
+ var packageVersion = "75.8.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -10,9 +10,47 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
10
10
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
11
11
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
12
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
14
+ var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
13
15
  var _state = require("@atlaskit/editor-prosemirror/state");
14
16
  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); }; }
15
17
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
18
+ // Wraper to avoid any exception during the get pos operation
19
+ // See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
20
+ // And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
21
+ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
22
+ var _spec$props;
23
+ if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
24
+ return spec;
25
+ }
26
+ var unsafeNodeViews = spec.props.nodeViews;
27
+ var safeNodeViews = new Proxy(unsafeNodeViews, {
28
+ get: function get(target, prop, receiver) {
29
+ var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
30
+ apply: function apply(target, thisArg, argumentsList) {
31
+ var _argumentsList = (0, _toArray2.default)(argumentsList),
32
+ node = _argumentsList[0],
33
+ view = _argumentsList[1],
34
+ unsafeGetPos = _argumentsList[2],
35
+ more = _argumentsList.slice(3);
36
+ var safeGetPos = function () {
37
+ try {
38
+ return unsafeGetPos();
39
+ } catch (e) {
40
+ return;
41
+ }
42
+ return;
43
+ // eslint-disable-next-line no-extra-bind
44
+ }.bind(thisArg);
45
+ return Reflect.apply(target, thisArg, [node, view, safeGetPos].concat((0, _toConsumableArray2.default)(more)));
46
+ }
47
+ });
48
+ return safeNodeView;
49
+ }
50
+ });
51
+ spec.props.nodeViews = safeNodeViews;
52
+ return spec;
53
+ };
16
54
  var SafePlugin = /*#__PURE__*/function (_Plugin) {
17
55
  (0, _inherits2.default)(SafePlugin, _Plugin);
18
56
  var _super = _createSuper(SafePlugin);
@@ -22,7 +60,7 @@ var SafePlugin = /*#__PURE__*/function (_Plugin) {
22
60
 
23
61
  function SafePlugin(spec) {
24
62
  (0, _classCallCheck2.default)(this, SafePlugin);
25
- return _super.call(this, spec);
63
+ return _super.call(this, wrapGetPosExceptions(spec));
26
64
  }
27
65
  return (0, _createClass2.default)(SafePlugin);
28
66
  }(_state.Plugin);
@@ -41,8 +41,11 @@ var TableSharedCssClassName = {
41
41
  TABLE_RIGHT_SHADOW: "".concat(_adfSchema.tablePrefixSelector, "-with-right-shadow"),
42
42
  TABLE_STICKY_SHADOW: "".concat(_adfSchema.tablePrefixSelector, "-sticky-shadow"),
43
43
  TABLE_STICKY_WRAPPER: "".concat(_adfSchema.tablePrefixSelector, "-sticky-wrapper"),
44
+ TABLE_STICKY_SCROLLBAR_CONTAINER: "".concat(_adfSchema.tablePrefixSelector, "-sticky-scrollbar-container"),
44
45
  TABLE_STICKY_SENTINEL_TOP: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-top"),
45
46
  TABLE_STICKY_SENTINEL_BOTTOM: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-bottom"),
47
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "".concat(_adfSchema.tablePrefixSelector, "-sticky-scrollbar-sentinel-top"),
48
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "".concat(_adfSchema.tablePrefixSelector, "-sticky-scrollbar-sentinel-bottom"),
46
49
  TABLE_SHADOW_SENTINEL_LEFT: "".concat(_adfSchema.tablePrefixSelector, "-shadow-sentinel-left"),
47
50
  TABLE_SHADOW_SENTINEL_RIGHT: "".concat(_adfSchema.tablePrefixSelector, "-shadow-sentinel-right"),
48
51
  TABLE_CELL_NODEVIEW_CONTENT_DOM: _adfSchema.tableCellContentDomSelector,
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
24
24
  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); }; }
25
25
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "75.7.1";
27
+ var packageVersion = "75.8.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -100,7 +100,8 @@ var Popup = /*#__PURE__*/function (_React$Component) {
100
100
  forcePlacement = props.forcePlacement,
101
101
  allowOutOfBounds = props.allowOutOfBounds,
102
102
  rect = props.rect,
103
- preventOverflow = props.preventOverflow;
103
+ preventOverflow = props.preventOverflow,
104
+ absoluteOffset = props.absoluteOffset;
104
105
  if (!target || !popup) {
105
106
  return {};
106
107
  }
@@ -119,6 +120,18 @@ var Popup = /*#__PURE__*/function (_React$Component) {
119
120
  rect: rect
120
121
  });
121
122
  position = onPositionCalculated ? onPositionCalculated(position) : position;
123
+ if (typeof position.top !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.top) {
124
+ position.top = position.top + absoluteOffset.top;
125
+ }
126
+ if (typeof position.bottom !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.bottom) {
127
+ position.bottom = position.bottom + absoluteOffset.bottom;
128
+ }
129
+ if (typeof position.right !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.right) {
130
+ position.right = position.right + absoluteOffset.right;
131
+ }
132
+ if (typeof position.left !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.left) {
133
+ position.left = position.left + absoluteOffset.left;
134
+ }
122
135
  return {
123
136
  position: position,
124
137
  validPosition: (0, _utils.validatePosition)(target)
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "75.7.1";
3
+ const packageVersion = "75.8.1";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -1,10 +1,42 @@
1
1
  import { Plugin } from '@atlaskit/editor-prosemirror/state';
2
+ // Wraper to avoid any exception during the get pos operation
3
+ // See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
4
+ // And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
5
+ const wrapGetPosExceptions = spec => {
6
+ var _spec$props;
7
+ if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
8
+ return spec;
9
+ }
10
+ const unsafeNodeViews = spec.props.nodeViews;
11
+ const safeNodeViews = new Proxy(unsafeNodeViews, {
12
+ get(target, prop, receiver) {
13
+ const safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
14
+ apply(target, thisArg, argumentsList) {
15
+ const [node, view, unsafeGetPos, ...more] = argumentsList;
16
+ const safeGetPos = (() => {
17
+ try {
18
+ return unsafeGetPos();
19
+ } catch (e) {
20
+ return;
21
+ }
22
+ return;
23
+ // eslint-disable-next-line no-extra-bind
24
+ }).bind(thisArg);
25
+ return Reflect.apply(target, thisArg, [node, view, safeGetPos, ...more]);
26
+ }
27
+ });
28
+ return safeNodeView;
29
+ }
30
+ });
31
+ spec.props.nodeViews = safeNodeViews;
32
+ return spec;
33
+ };
2
34
  export class SafePlugin extends Plugin {
3
35
  // This variable isn't (and shouldn't) be used anywhere. Its purpose is
4
36
  // to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
5
37
  // Plugin cannot be assigned as an item in EditorPlugin → pmPlugins.
6
38
 
7
39
  constructor(spec) {
8
- super(spec);
40
+ super(wrapGetPosExceptions(spec));
9
41
  }
10
42
  }
@@ -24,8 +24,11 @@ export const TableSharedCssClassName = {
24
24
  TABLE_RIGHT_SHADOW: `${tablePrefixSelector}-with-right-shadow`,
25
25
  TABLE_STICKY_SHADOW: `${tablePrefixSelector}-sticky-shadow`,
26
26
  TABLE_STICKY_WRAPPER: `${tablePrefixSelector}-sticky-wrapper`,
27
+ TABLE_STICKY_SCROLLBAR_CONTAINER: `${tablePrefixSelector}-sticky-scrollbar-container`,
27
28
  TABLE_STICKY_SENTINEL_TOP: `${tablePrefixSelector}-sticky-sentinel-top`,
28
29
  TABLE_STICKY_SENTINEL_BOTTOM: `${tablePrefixSelector}-sticky-sentinel-bottom`,
30
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: `${tablePrefixSelector}-sticky-scrollbar-sentinel-top`,
31
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: `${tablePrefixSelector}-sticky-scrollbar-sentinel-bottom`,
29
32
  TABLE_SHADOW_SENTINEL_LEFT: `${tablePrefixSelector}-shadow-sentinel-left`,
30
33
  TABLE_SHADOW_SENTINEL_RIGHT: `${tablePrefixSelector}-shadow-sentinel-right`,
31
34
  TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius } from '@atlaskit/theme/constants';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "75.7.1";
12
+ const packageVersion = "75.8.1";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -65,7 +65,8 @@ export default class Popup extends React.Component {
65
65
  forcePlacement,
66
66
  allowOutOfBounds,
67
67
  rect,
68
- preventOverflow
68
+ preventOverflow,
69
+ absoluteOffset
69
70
  } = props;
70
71
  if (!target || !popup) {
71
72
  return {};
@@ -85,6 +86,18 @@ export default class Popup extends React.Component {
85
86
  rect
86
87
  });
87
88
  position = onPositionCalculated ? onPositionCalculated(position) : position;
89
+ if (typeof position.top !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.top) {
90
+ position.top = position.top + absoluteOffset.top;
91
+ }
92
+ if (typeof position.bottom !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.bottom) {
93
+ position.bottom = position.bottom + absoluteOffset.bottom;
94
+ }
95
+ if (typeof position.right !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.right) {
96
+ position.right = position.right + absoluteOffset.right;
97
+ }
98
+ if (typeof position.left !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.left) {
99
+ position.left = position.left + absoluteOffset.left;
100
+ }
88
101
  return {
89
102
  position,
90
103
  validPosition: validatePosition(target)
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  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; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "75.7.1";
9
+ var packageVersion = "75.8.1";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -3,9 +3,47 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _inherits from "@babel/runtime/helpers/inherits";
4
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
7
+ import _toArray from "@babel/runtime/helpers/toArray";
6
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
7
9
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
10
  import { Plugin } from '@atlaskit/editor-prosemirror/state';
11
+ // Wraper to avoid any exception during the get pos operation
12
+ // See this https://hello.atlassian.net/wiki/spaces/EDITOR/pages/2849713193/ED-19672+Extensions+Regression
13
+ // And this https://discuss.prosemirror.net/t/possible-bug-on-viewdesc-posbeforechild/5783
14
+ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
15
+ var _spec$props;
16
+ if (!(spec !== null && spec !== void 0 && (_spec$props = spec.props) !== null && _spec$props !== void 0 && _spec$props.nodeViews)) {
17
+ return spec;
18
+ }
19
+ var unsafeNodeViews = spec.props.nodeViews;
20
+ var safeNodeViews = new Proxy(unsafeNodeViews, {
21
+ get: function get(target, prop, receiver) {
22
+ var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
23
+ apply: function apply(target, thisArg, argumentsList) {
24
+ var _argumentsList = _toArray(argumentsList),
25
+ node = _argumentsList[0],
26
+ view = _argumentsList[1],
27
+ unsafeGetPos = _argumentsList[2],
28
+ more = _argumentsList.slice(3);
29
+ var safeGetPos = function () {
30
+ try {
31
+ return unsafeGetPos();
32
+ } catch (e) {
33
+ return;
34
+ }
35
+ return;
36
+ // eslint-disable-next-line no-extra-bind
37
+ }.bind(thisArg);
38
+ return Reflect.apply(target, thisArg, [node, view, safeGetPos].concat(_toConsumableArray(more)));
39
+ }
40
+ });
41
+ return safeNodeView;
42
+ }
43
+ });
44
+ spec.props.nodeViews = safeNodeViews;
45
+ return spec;
46
+ };
9
47
  export var SafePlugin = /*#__PURE__*/function (_Plugin) {
10
48
  _inherits(SafePlugin, _Plugin);
11
49
  var _super = _createSuper(SafePlugin);
@@ -15,7 +53,7 @@ export var SafePlugin = /*#__PURE__*/function (_Plugin) {
15
53
 
16
54
  function SafePlugin(spec) {
17
55
  _classCallCheck(this, SafePlugin);
18
- return _super.call(this, spec);
56
+ return _super.call(this, wrapGetPosExceptions(spec));
19
57
  }
20
58
  return _createClass(SafePlugin);
21
59
  }(Plugin);
@@ -26,8 +26,11 @@ export var TableSharedCssClassName = {
26
26
  TABLE_RIGHT_SHADOW: "".concat(tablePrefixSelector, "-with-right-shadow"),
27
27
  TABLE_STICKY_SHADOW: "".concat(tablePrefixSelector, "-sticky-shadow"),
28
28
  TABLE_STICKY_WRAPPER: "".concat(tablePrefixSelector, "-sticky-wrapper"),
29
+ TABLE_STICKY_SCROLLBAR_CONTAINER: "".concat(tablePrefixSelector, "-sticky-scrollbar-container"),
29
30
  TABLE_STICKY_SENTINEL_TOP: "".concat(tablePrefixSelector, "-sticky-sentinel-top"),
30
31
  TABLE_STICKY_SENTINEL_BOTTOM: "".concat(tablePrefixSelector, "-sticky-sentinel-bottom"),
32
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "".concat(tablePrefixSelector, "-sticky-scrollbar-sentinel-top"),
33
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "".concat(tablePrefixSelector, "-sticky-scrollbar-sentinel-bottom"),
31
34
  TABLE_SHADOW_SENTINEL_LEFT: "".concat(tablePrefixSelector, "-shadow-sentinel-left"),
32
35
  TABLE_SHADOW_SENTINEL_RIGHT: "".concat(tablePrefixSelector, "-shadow-sentinel-right"),
33
36
  TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
19
19
  import { borderRadius } from '@atlaskit/theme/constants';
20
20
  import Layer from '../Layer';
21
21
  var packageName = "@atlaskit/editor-common";
22
- var packageVersion = "75.7.1";
22
+ var packageVersion = "75.8.1";
23
23
  var halfFocusRing = 1;
24
24
  var dropOffset = '0, 8';
25
25
  var DropList = /*#__PURE__*/function (_Component) {
@@ -87,7 +87,8 @@ var Popup = /*#__PURE__*/function (_React$Component) {
87
87
  forcePlacement = props.forcePlacement,
88
88
  allowOutOfBounds = props.allowOutOfBounds,
89
89
  rect = props.rect,
90
- preventOverflow = props.preventOverflow;
90
+ preventOverflow = props.preventOverflow,
91
+ absoluteOffset = props.absoluteOffset;
91
92
  if (!target || !popup) {
92
93
  return {};
93
94
  }
@@ -106,6 +107,18 @@ var Popup = /*#__PURE__*/function (_React$Component) {
106
107
  rect: rect
107
108
  });
108
109
  position = onPositionCalculated ? onPositionCalculated(position) : position;
110
+ if (typeof position.top !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.top) {
111
+ position.top = position.top + absoluteOffset.top;
112
+ }
113
+ if (typeof position.bottom !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.bottom) {
114
+ position.bottom = position.bottom + absoluteOffset.bottom;
115
+ }
116
+ if (typeof position.right !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.right) {
117
+ position.right = position.right + absoluteOffset.right;
118
+ }
119
+ if (typeof position.left !== 'undefined' && absoluteOffset !== null && absoluteOffset !== void 0 && absoluteOffset.left) {
120
+ position.left = position.left + absoluteOffset.left;
121
+ }
109
122
  return {
110
123
  position: position,
111
124
  validPosition: validatePosition(target)
@@ -1,4 +1,5 @@
1
- import { Plugin, SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
1
+ import { Plugin } from '@atlaskit/editor-prosemirror/state';
2
+ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
2
3
  export declare class SafePlugin<T = any> extends Plugin<T> {
3
4
  _isATypeSafePlugin: never;
4
5
  constructor(spec: SafePluginSpec<T>);
@@ -16,8 +16,11 @@ export declare const TableSharedCssClassName: {
16
16
  TABLE_RIGHT_SHADOW: string;
17
17
  TABLE_STICKY_SHADOW: string;
18
18
  TABLE_STICKY_WRAPPER: string;
19
+ TABLE_STICKY_SCROLLBAR_CONTAINER: string;
19
20
  TABLE_STICKY_SENTINEL_TOP: string;
20
21
  TABLE_STICKY_SENTINEL_BOTTOM: string;
22
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
23
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
21
24
  TABLE_SHADOW_SENTINEL_LEFT: string;
22
25
  TABLE_SHADOW_SENTINEL_RIGHT: string;
23
26
  TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
@@ -56,6 +56,7 @@ interface Position {
56
56
  bottom?: number;
57
57
  left?: number;
58
58
  }
59
+ type PositionOffset = Position;
59
60
  export type ConfirmDialogChildInfo = {
60
61
  id: string;
61
62
  name: string | null;
@@ -241,6 +242,8 @@ export interface FloatingToolbarConfig {
241
242
  zIndex?: number;
242
243
  /** Offset the position of the toolbar. */
243
244
  offset?: [number, number];
245
+ /** Absolute offset of the toolbar */
246
+ absoluteOffset?: PositionOffset;
244
247
  forcePlacement?: boolean;
245
248
  onPositionCalculated?: (editorView: EditorView, nextPos: Position) => Position;
246
249
  scrollable?: boolean;
@@ -24,6 +24,7 @@ export interface Props {
24
24
  /** Enable focus trap to contain the user's focus within the popup */
25
25
  focusTrap?: boolean;
26
26
  preventOverflow?: boolean;
27
+ absoluteOffset?: Position;
27
28
  }
28
29
  export interface State {
29
30
  popup?: HTMLElement;
@@ -1,4 +1,5 @@
1
- import { Plugin, SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
1
+ import { Plugin } from '@atlaskit/editor-prosemirror/state';
2
+ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
2
3
  export declare class SafePlugin<T = any> extends Plugin<T> {
3
4
  _isATypeSafePlugin: never;
4
5
  constructor(spec: SafePluginSpec<T>);
@@ -16,8 +16,11 @@ export declare const TableSharedCssClassName: {
16
16
  TABLE_RIGHT_SHADOW: string;
17
17
  TABLE_STICKY_SHADOW: string;
18
18
  TABLE_STICKY_WRAPPER: string;
19
+ TABLE_STICKY_SCROLLBAR_CONTAINER: string;
19
20
  TABLE_STICKY_SENTINEL_TOP: string;
20
21
  TABLE_STICKY_SENTINEL_BOTTOM: string;
22
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: string;
23
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: string;
21
24
  TABLE_SHADOW_SENTINEL_LEFT: string;
22
25
  TABLE_SHADOW_SENTINEL_RIGHT: string;
23
26
  TABLE_CELL_NODEVIEW_CONTENT_DOM: string;
@@ -56,6 +56,7 @@ interface Position {
56
56
  bottom?: number;
57
57
  left?: number;
58
58
  }
59
+ type PositionOffset = Position;
59
60
  export type ConfirmDialogChildInfo = {
60
61
  id: string;
61
62
  name: string | null;
@@ -244,6 +245,8 @@ export interface FloatingToolbarConfig {
244
245
  number,
245
246
  number
246
247
  ];
248
+ /** Absolute offset of the toolbar */
249
+ absoluteOffset?: PositionOffset;
247
250
  forcePlacement?: boolean;
248
251
  onPositionCalculated?: (editorView: EditorView, nextPos: Position) => Position;
249
252
  scrollable?: boolean;
@@ -27,6 +27,7 @@ export interface Props {
27
27
  /** Enable focus trap to contain the user's focus within the popup */
28
28
  focusTrap?: boolean;
29
29
  preventOverflow?: boolean;
30
+ absoluteOffset?: Position;
30
31
  }
31
32
  export interface State {
32
33
  popup?: HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "75.7.1",
3
+ "version": "75.8.1",
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/"
@@ -95,13 +95,13 @@
95
95
  "@atlaskit/editor-json-transformer": "^8.10.0",
96
96
  "@atlaskit/editor-palette": "1.5.1",
97
97
  "@atlaskit/editor-prosemirror": "1.1.0",
98
- "@atlaskit/editor-shared-styles": "^2.7.0",
98
+ "@atlaskit/editor-shared-styles": "^2.8.0",
99
99
  "@atlaskit/editor-tables": "^2.3.0",
100
100
  "@atlaskit/emoji": "^67.5.0",
101
101
  "@atlaskit/icon": "^21.12.0",
102
102
  "@atlaskit/icon-object": "^6.3.0",
103
103
  "@atlaskit/in-product-testing": "^0.2.0",
104
- "@atlaskit/link-datasource": "^1.3.0",
104
+ "@atlaskit/link-datasource": "^1.4.0",
105
105
  "@atlaskit/link-picker": "^1.30.0",
106
106
  "@atlaskit/media-card": "^77.0.0",
107
107
  "@atlaskit/media-client": "^24.0.0",