@atlaskit/editor-common 75.7.0 → 75.8.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,21 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 75.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3aaff60be08`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3aaff60be08) - ED-18988 Adds classnames and constants for table sticky scrollbar
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 75.7.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [`7b3e5b2915d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7b3e5b2915d) - Dummy change to bump version
18
+
3
19
  ## 75.7.0
4
20
 
5
21
  ### Minor 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.0";
19
+ var packageVersion = "75.8.0";
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
@@ -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.0";
27
+ var packageVersion = "75.8.0";
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.0";
3
+ const packageVersion = "75.8.0";
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
@@ -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.0";
12
+ const packageVersion = "75.8.0";
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.0";
9
+ var packageVersion = "75.8.0";
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
@@ -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.0";
22
+ var packageVersion = "75.8.0";
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)
@@ -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;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
2
+ import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
5
- import { AnnotationState, AnnotationUpdateEmitter, AnnotationUpdateEvent, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
5
+ import type { AnnotationState, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
6
+ import { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './emitter';
6
7
  export type { AnnotationState };
7
8
  export type AnnotationByMatches = {
8
9
  originalSelection: string;
@@ -24,7 +25,7 @@ export type InlineCommentSelectionComponentProps = {
24
25
  */
25
26
  range: Range;
26
27
  /**
27
- * Renderer/Editor DOM element ancestors wrapping the selection.
28
+ * Renderer/Editor DOM element ancestors wrapping the selection
28
29
  */
29
30
  wrapperDOM: HTMLElement;
30
31
  /**
@@ -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;
@@ -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;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
2
+ import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  import type { Step } from '@atlaskit/editor-prosemirror/transform';
5
- import { AnnotationState, AnnotationUpdateEmitter, AnnotationUpdateEvent, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
5
+ import type { AnnotationState, AnnotationUpdateEventPayloads, OnAnnotationClickPayload } from './emitter';
6
+ import { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './emitter';
6
7
  export type { AnnotationState };
7
8
  export type AnnotationByMatches = {
8
9
  originalSelection: string;
@@ -24,7 +25,7 @@ export type InlineCommentSelectionComponentProps = {
24
25
  */
25
26
  range: Range;
26
27
  /**
27
- * Renderer/Editor DOM element ancestors wrapping the selection.
28
+ * Renderer/Editor DOM element ancestors wrapping the selection
28
29
  */
29
30
  wrapperDOM: HTMLElement;
30
31
  /**
@@ -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.0",
3
+ "version": "75.8.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/"
@@ -95,7 +95,7 @@
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",