@atlaskit/editor-common 134.9.3 → 134.10.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,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 134.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`77aeba2398de1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/77aeba2398de1) -
8
+ Update i18n NPM package versions for editor,editor-extensions,activity-platform,media,elements
9
+ (Group 3)
10
+ - [`969bc780b9fda`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/969bc780b9fda) -
11
+ Keep the top of editor popups that are taller than the visible scroll area inside it (pinned below
12
+ the visible top) behind platform_editor_popup_clamp_to_scroll_area
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 134.9.3
4
19
 
5
20
  ### Patch Changes
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "134.9.2";
30
+ var packageVersion = "134.9.3";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "134.9.2";
26
+ var packageVersion = "134.9.3";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "validatePosition", {
29
29
  });
30
30
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
31
31
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
32
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
32
33
  var _isBody = require("./isBody");
33
34
  var _isTextNode = require("./isTextNode");
34
35
  var _validatePosition = require("./validatePosition");
@@ -180,6 +181,13 @@ var getPopupXInsideParent = function getPopupXInsideParent(x, popupClientWidth,
180
181
  // prevent going too far left
181
182
  return Math.max(minPopupMargin, x);
182
183
  };
184
+
185
+ /**
186
+ * Lifts a bottom-placed popup that would run past the visible bottom of its scroll parent so its
187
+ * bottom sits `offset` above that edge. Under `platform_editor_popup_clamp_to_scroll_area`, a popup
188
+ * taller than the visible area is instead pinned `offset` below the visible top, so its start (for
189
+ * the link picker, the URL field) is never clipped; its bottom may extend past the visible area.
190
+ */
183
191
  var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2) {
184
192
  var target = _ref2.target,
185
193
  targetTop = _ref2.targetTop,
@@ -192,13 +200,22 @@ var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2)
192
200
  var scrollParent = scrollableElement || findOverflowScrollParent(target) || boundariesElement;
193
201
  var newPos = _objectSpread({}, position);
194
202
  if (scrollParent) {
203
+ var margin = offset[1];
204
+ var visibleHeight = scrollParent.clientHeight;
195
205
  var topOffsetTop = targetTop - scrollParent.getBoundingClientRect().top;
196
206
  var targetEnd = targetHeight + topOffsetTop;
197
- if (scrollParent.clientHeight - targetEnd <= popup.clientHeight + offset[1] * 2 && topOffsetTop < scrollParent.clientHeight) {
198
- var scroll = targetEnd - scrollParent.clientHeight + offset[1] * 2;
199
- var top = newPos.top || 0;
200
- top = top - (scroll + popup.clientHeight);
201
- newPos.top = top;
207
+ var popupHeight = popup.clientHeight;
208
+ if (visibleHeight - targetEnd <= popupHeight + margin * 2 && topOffsetTop < visibleHeight) {
209
+ var scroll = targetEnd - visibleHeight + margin * 2;
210
+ var liftedTop = (newPos.top || 0) - (scroll + popupHeight);
211
+ // Lifting only clips the popup once its top would pass the visible top.
212
+ var liftsAboveVisibleTop = popupHeight > visibleHeight - margin;
213
+ if (liftsAboveVisibleTop && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_popup_clamp_to_scroll_area')) {
214
+ var scrollAreaTop = liftedTop + popupHeight + margin - visibleHeight;
215
+ newPos.top = scrollAreaTop + margin;
216
+ } else {
217
+ newPos.top = liftedTop;
218
+ }
202
219
  }
203
220
  }
204
221
  return newPos;
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "134.9.2";
16
+ const packageVersion = "134.9.3";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "134.9.2";
16
+ const packageVersion = "134.9.3";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -1,3 +1,4 @@
1
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
1
2
  import { isBody } from './isBody';
2
3
  import { isTextNode } from './isTextNode';
3
4
  /**
@@ -150,6 +151,13 @@ const getPopupXInsideParent = (x, popupClientWidth, popupOffsetParentClientWidth
150
151
  // prevent going too far left
151
152
  return Math.max(minPopupMargin, x);
152
153
  };
154
+
155
+ /**
156
+ * Lifts a bottom-placed popup that would run past the visible bottom of its scroll parent so its
157
+ * bottom sits `offset` above that edge. Under `platform_editor_popup_clamp_to_scroll_area`, a popup
158
+ * taller than the visible area is instead pinned `offset` below the visible top, so its start (for
159
+ * the link picker, the URL field) is never clipped; its bottom may extend past the visible area.
160
+ */
153
161
  const calculateVerticalStickBottom = ({
154
162
  target,
155
163
  targetTop,
@@ -165,13 +173,22 @@ const calculateVerticalStickBottom = ({
165
173
  ...position
166
174
  };
167
175
  if (scrollParent) {
176
+ const margin = offset[1];
177
+ const visibleHeight = scrollParent.clientHeight;
168
178
  const topOffsetTop = targetTop - scrollParent.getBoundingClientRect().top;
169
179
  const targetEnd = targetHeight + topOffsetTop;
170
- if (scrollParent.clientHeight - targetEnd <= popup.clientHeight + offset[1] * 2 && topOffsetTop < scrollParent.clientHeight) {
171
- const scroll = targetEnd - scrollParent.clientHeight + offset[1] * 2;
172
- let top = newPos.top || 0;
173
- top = top - (scroll + popup.clientHeight);
174
- newPos.top = top;
180
+ const popupHeight = popup.clientHeight;
181
+ if (visibleHeight - targetEnd <= popupHeight + margin * 2 && topOffsetTop < visibleHeight) {
182
+ const scroll = targetEnd - visibleHeight + margin * 2;
183
+ const liftedTop = (newPos.top || 0) - (scroll + popupHeight);
184
+ // Lifting only clips the popup once its top would pass the visible top.
185
+ const liftsAboveVisibleTop = popupHeight > visibleHeight - margin;
186
+ if (liftsAboveVisibleTop && isExperimentEnabled('platform_editor_popup_clamp_to_scroll_area')) {
187
+ const scrollAreaTop = liftedTop + popupHeight + margin - visibleHeight;
188
+ newPos.top = scrollAreaTop + margin;
189
+ } else {
190
+ newPos.top = liftedTop;
191
+ }
175
192
  }
176
193
  }
177
194
  return newPos;
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "134.9.2";
22
+ var packageVersion = "134.9.3";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "134.9.2";
23
+ var packageVersion = "134.9.3";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  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; }
4
4
  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; }
5
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
5
6
  import { isBody } from './isBody';
6
7
  import { isTextNode } from './isTextNode';
7
8
  /**
@@ -150,6 +151,13 @@ var getPopupXInsideParent = function getPopupXInsideParent(x, popupClientWidth,
150
151
  // prevent going too far left
151
152
  return Math.max(minPopupMargin, x);
152
153
  };
154
+
155
+ /**
156
+ * Lifts a bottom-placed popup that would run past the visible bottom of its scroll parent so its
157
+ * bottom sits `offset` above that edge. Under `platform_editor_popup_clamp_to_scroll_area`, a popup
158
+ * taller than the visible area is instead pinned `offset` below the visible top, so its start (for
159
+ * the link picker, the URL field) is never clipped; its bottom may extend past the visible area.
160
+ */
153
161
  var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2) {
154
162
  var target = _ref2.target,
155
163
  targetTop = _ref2.targetTop,
@@ -162,13 +170,22 @@ var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2)
162
170
  var scrollParent = scrollableElement || findOverflowScrollParent(target) || boundariesElement;
163
171
  var newPos = _objectSpread({}, position);
164
172
  if (scrollParent) {
173
+ var margin = offset[1];
174
+ var visibleHeight = scrollParent.clientHeight;
165
175
  var topOffsetTop = targetTop - scrollParent.getBoundingClientRect().top;
166
176
  var targetEnd = targetHeight + topOffsetTop;
167
- if (scrollParent.clientHeight - targetEnd <= popup.clientHeight + offset[1] * 2 && topOffsetTop < scrollParent.clientHeight) {
168
- var scroll = targetEnd - scrollParent.clientHeight + offset[1] * 2;
169
- var top = newPos.top || 0;
170
- top = top - (scroll + popup.clientHeight);
171
- newPos.top = top;
177
+ var popupHeight = popup.clientHeight;
178
+ if (visibleHeight - targetEnd <= popupHeight + margin * 2 && topOffsetTop < visibleHeight) {
179
+ var scroll = targetEnd - visibleHeight + margin * 2;
180
+ var liftedTop = (newPos.top || 0) - (scroll + popupHeight);
181
+ // Lifting only clips the popup once its top would pass the visible top.
182
+ var liftsAboveVisibleTop = popupHeight > visibleHeight - margin;
183
+ if (liftsAboveVisibleTop && isExperimentEnabled('platform_editor_popup_clamp_to_scroll_area')) {
184
+ var scrollAreaTop = liftedTop + popupHeight + margin - visibleHeight;
185
+ newPos.top = scrollAreaTop + margin;
186
+ } else {
187
+ newPos.top = liftedTop;
188
+ }
172
189
  }
173
190
  }
174
191
  return newPos;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "134.9.3",
3
+ "version": "134.10.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/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/activity-provider": "^3.1.0",
32
32
  "@atlaskit/adf-schema": "^57.7.0",
33
33
  "@atlaskit/adf-utils": "^20.9.0",
34
- "@atlaskit/afm-i18n-platform-editor-editor-common": "2.294.0",
34
+ "@atlaskit/afm-i18n-platform-editor-editor-common": "2.305.0",
35
35
  "@atlaskit/analytics-listeners": "^11.4.0",
36
36
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
37
37
  "@atlaskit/analytics-next": "^12.6.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/editor-toolbar": "^2.10.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",
52
52
  "@atlaskit/editor-ui-control-model": "^3.0.0",
53
- "@atlaskit/emoji": "^73.4.0",
53
+ "@atlaskit/emoji": "^73.5.0",
54
54
  "@atlaskit/feature-gate-js-client": "^8.0.0",
55
55
  "@atlaskit/icon": "^38.0.0",
56
56
  "@atlaskit/link": "^5.1.0",
@@ -63,9 +63,9 @@
63
63
  "@atlaskit/media-common": "^14.7.0",
64
64
  "@atlaskit/media-file-preview": "^2.0.0",
65
65
  "@atlaskit/media-picker": "^73.3.0",
66
- "@atlaskit/media-ui": "^31.6.0",
66
+ "@atlaskit/media-ui": "^31.7.0",
67
67
  "@atlaskit/media-viewer": "^54.12.0",
68
- "@atlaskit/mention": "^30.7.0",
68
+ "@atlaskit/mention": "^30.8.0",
69
69
  "@atlaskit/menu": "^11.0.0",
70
70
  "@atlaskit/object": "^2.3.0",
71
71
  "@atlaskit/onboarding": "^15.4.0",
@@ -82,7 +82,7 @@
82
82
  "@atlaskit/smart-card": "^46.13.0",
83
83
  "@atlaskit/smart-user-picker": "^12.11.0",
84
84
  "@atlaskit/spinner": "^20.4.0",
85
- "@atlaskit/task-decision": "^21.14.0",
85
+ "@atlaskit/task-decision": "^21.15.0",
86
86
  "@atlaskit/teams-app-config": "^3.1.0",
87
87
  "@atlaskit/textfield": "^10.3.0",
88
88
  "@atlaskit/tmp-editor-statsig": "^260.0.0",