@atlaskit/editor-common 96.3.3 → 96.3.4

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
+ ## 96.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#166865](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/166865)
8
+ [`198153bb77b2f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/198153bb77b2f) -
9
+ Ensure gap cursor is displayed when element is unmounted
10
+ - [#174793](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/174793)
11
+ [`43b642d08a4ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43b642d08a4ec) -
12
+ ED-24453 delay decoration removal on edge when users are interacting with spelling suggestions
13
+ - Updated dependencies
14
+
3
15
  ## 96.3.3
4
16
 
5
17
  ### Patch Changes
@@ -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 && {}.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 = "96.3.3";
20
+ var packageVersion = "96.3.4";
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
@@ -160,6 +160,12 @@ var BreakoutResizer = exports.BreakoutResizer = function BreakoutResizer(_ref) {
160
160
  maxWidth: undefined
161
161
  });
162
162
  }, [getPos, editorView, displayGapCursor, editorAnalyticsApi]);
163
+ (0, _react.useEffect)(function () {
164
+ // clean up gap cursor if node was unmounting when resizing (e.g. during collab)
165
+ return function () {
166
+ displayGapCursor(true);
167
+ };
168
+ }, [displayGapCursor]);
163
169
  if (disabled) {
164
170
  return /*#__PURE__*/_react.default.createElement("div", {
165
171
  "data-testid": "breakout-resizer-editor-view-wrapper",
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "96.3.3";
27
+ var packageVersion = "96.3.4";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -49,6 +49,14 @@ var breakoutConsts = exports.breakoutConsts = {
49
49
  return '100%';
50
50
  }
51
51
  },
52
+ calcBreakoutWithCustomWidth: function calcBreakoutWithCustomWidth(mode, width, editorContainerWidth) {
53
+ if (width !== null && width > 0) {
54
+ var effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
55
+ // if below 0 then expect we're rendering in SSR
56
+ return "".concat(Math.min(width, effectiveFullWidth), "px");
57
+ }
58
+ return breakoutConsts.calcBreakoutWidth(mode, editorContainerWidth);
59
+ },
52
60
  calcLineLength: function calcLineLength() {
53
61
  return breakoutConsts.defaultLayoutWidth;
54
62
  },
@@ -81,15 +89,7 @@ var absoluteBreakoutWidth = exports.absoluteBreakoutWidth = function absoluteBre
81
89
  };
82
90
  var calcWideWidth = exports.calcWideWidth = breakoutConsts.calcWideWidth;
83
91
  var calcBreakoutWidth = exports.calcBreakoutWidth = breakoutConsts.calcBreakoutWidth;
84
-
85
- // Calculate width for nodes using resizing and breakout mark, only applied in renderer
86
- var calcBreakoutWithCustomWidth = exports.calcBreakoutWithCustomWidth = function calcBreakoutWithCustomWidth(mode, width, editorContainerWidth) {
87
- if (width !== null && width > 0) {
88
- var effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
89
- return "".concat(Math.min(width, effectiveFullWidth), "px");
90
- }
91
- return calcBreakoutWidth(mode, editorContainerWidth);
92
- };
92
+ var calcBreakoutWithCustomWidth = exports.calcBreakoutWithCustomWidth = breakoutConsts.calcBreakoutWithCustomWidth;
93
93
  function calculateBreakoutStyles(_ref) {
94
94
  var mode = _ref.mode,
95
95
  widthStateLineLength = _ref.widthStateLineLength,
@@ -23,7 +23,7 @@ var result = exports.browser = {
23
23
  };
24
24
  if (typeof navigator !== 'undefined') {
25
25
  var _userAgentData;
26
- var ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
26
+ var ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
27
27
  var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
28
28
  var ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
29
29
  result.mac = /Mac/.test(navigator.platform);
@@ -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 = "96.3.3";
4
+ const packageVersion = "96.3.4";
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
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useMemo, useState } from 'react';
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
3
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
@@ -155,6 +155,12 @@ const BreakoutResizer = ({
155
155
  maxWidth: undefined
156
156
  });
157
157
  }, [getPos, editorView, displayGapCursor, editorAnalyticsApi]);
158
+ useEffect(() => {
159
+ // clean up gap cursor if node was unmounting when resizing (e.g. during collab)
160
+ return () => {
161
+ displayGapCursor(true);
162
+ };
163
+ }, [displayGapCursor]);
158
164
  if (disabled) {
159
165
  return /*#__PURE__*/React.createElement("div", {
160
166
  "data-testid": "breakout-resizer-editor-view-wrapper",
@@ -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 = "96.3.3";
16
+ const packageVersion = "96.3.4";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  class DropList extends Component {
@@ -39,6 +39,14 @@ const breakoutConsts = {
39
39
  return '100%';
40
40
  }
41
41
  },
42
+ calcBreakoutWithCustomWidth: (mode, width, editorContainerWidth) => {
43
+ if (width !== null && width > 0) {
44
+ const effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
45
+ // if below 0 then expect we're rendering in SSR
46
+ return `${Math.min(width, effectiveFullWidth)}px`;
47
+ }
48
+ return breakoutConsts.calcBreakoutWidth(mode, editorContainerWidth);
49
+ },
42
50
  calcLineLength: () => breakoutConsts.defaultLayoutWidth,
43
51
  calcWideWidth: (containerWidth = breakoutConsts.defaultLayoutWidth, maxWidth = Infinity, fallback = '100%', padding) => {
44
52
  const effectiveFullWidth = containerWidth - (padding !== null && padding !== void 0 ? padding : breakoutConsts.padding);
@@ -66,15 +74,7 @@ export const absoluteBreakoutWidth = (layout, containerWidth) => {
66
74
  export { breakoutConsts };
67
75
  export const calcWideWidth = breakoutConsts.calcWideWidth;
68
76
  export const calcBreakoutWidth = breakoutConsts.calcBreakoutWidth;
69
-
70
- // Calculate width for nodes using resizing and breakout mark, only applied in renderer
71
- export const calcBreakoutWithCustomWidth = (mode, width, editorContainerWidth) => {
72
- if (width !== null && width > 0) {
73
- const effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
74
- return `${Math.min(width, effectiveFullWidth)}px`;
75
- }
76
- return calcBreakoutWidth(mode, editorContainerWidth);
77
- };
77
+ export const calcBreakoutWithCustomWidth = breakoutConsts.calcBreakoutWithCustomWidth;
78
78
  export function calculateBreakoutStyles({
79
79
  mode,
80
80
  widthStateLineLength,
@@ -17,7 +17,7 @@ const result = {
17
17
  };
18
18
  if (typeof navigator !== 'undefined') {
19
19
  var _userAgentData;
20
- const ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
20
+ const ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
21
21
  const ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
22
22
  const ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
23
23
  result.mac = /Mac/.test(navigator.platform);
@@ -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 = "96.3.3";
10
+ var packageVersion = "96.3.4";
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
@@ -1,5 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import React, { useCallback, useMemo, useState } from 'react';
2
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
4
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
@@ -150,6 +150,12 @@ var BreakoutResizer = function BreakoutResizer(_ref) {
150
150
  maxWidth: undefined
151
151
  });
152
152
  }, [getPos, editorView, displayGapCursor, editorAnalyticsApi]);
153
+ useEffect(function () {
154
+ // clean up gap cursor if node was unmounting when resizing (e.g. during collab)
155
+ return function () {
156
+ displayGapCursor(true);
157
+ };
158
+ }, [displayGapCursor]);
153
159
  if (disabled) {
154
160
  return /*#__PURE__*/React.createElement("div", {
155
161
  "data-testid": "breakout-resizer-editor-view-wrapper",
@@ -21,7 +21,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
21
21
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "96.3.3";
24
+ var packageVersion = "96.3.4";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var DropList = /*#__PURE__*/function (_Component) {
@@ -39,6 +39,14 @@ var breakoutConsts = {
39
39
  return '100%';
40
40
  }
41
41
  },
42
+ calcBreakoutWithCustomWidth: function calcBreakoutWithCustomWidth(mode, width, editorContainerWidth) {
43
+ if (width !== null && width > 0) {
44
+ var effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
45
+ // if below 0 then expect we're rendering in SSR
46
+ return "".concat(Math.min(width, effectiveFullWidth), "px");
47
+ }
48
+ return breakoutConsts.calcBreakoutWidth(mode, editorContainerWidth);
49
+ },
42
50
  calcLineLength: function calcLineLength() {
43
51
  return breakoutConsts.defaultLayoutWidth;
44
52
  },
@@ -72,15 +80,7 @@ export var absoluteBreakoutWidth = function absoluteBreakoutWidth(layout, contai
72
80
  export { breakoutConsts };
73
81
  export var calcWideWidth = breakoutConsts.calcWideWidth;
74
82
  export var calcBreakoutWidth = breakoutConsts.calcBreakoutWidth;
75
-
76
- // Calculate width for nodes using resizing and breakout mark, only applied in renderer
77
- export var calcBreakoutWithCustomWidth = function calcBreakoutWithCustomWidth(mode, width, editorContainerWidth) {
78
- if (width !== null && width > 0) {
79
- var effectiveFullWidth = editorContainerWidth - breakoutConsts.padding;
80
- return "".concat(Math.min(width, effectiveFullWidth), "px");
81
- }
82
- return calcBreakoutWidth(mode, editorContainerWidth);
83
- };
83
+ export var calcBreakoutWithCustomWidth = breakoutConsts.calcBreakoutWithCustomWidth;
84
84
  export function calculateBreakoutStyles(_ref) {
85
85
  var mode = _ref.mode,
86
86
  widthStateLineLength = _ref.widthStateLineLength,
@@ -17,7 +17,7 @@ var result = {
17
17
  };
18
18
  if (typeof navigator !== 'undefined') {
19
19
  var _userAgentData;
20
- var ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
20
+ var ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
21
21
  var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
22
22
  var ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
23
23
  result.mac = /Mac/.test(navigator.platform);
@@ -11,7 +11,7 @@ export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | str
11
11
  export { breakoutConsts };
12
12
  export declare const calcWideWidth: any;
13
13
  export declare const calcBreakoutWidth: any;
14
- export declare const calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => any;
14
+ export declare const calcBreakoutWithCustomWidth: any;
15
15
  export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
16
16
  mode: BreakoutMarkAttrs['mode'];
17
17
  /**
@@ -11,7 +11,7 @@ export declare const absoluteBreakoutWidth: (layout: 'full-width' | 'wide' | str
11
11
  export { breakoutConsts };
12
12
  export declare const calcWideWidth: any;
13
13
  export declare const calcBreakoutWidth: any;
14
- export declare const calcBreakoutWithCustomWidth: (mode: 'full-width' | 'wide', width: number | null, editorContainerWidth: number) => any;
14
+ export declare const calcBreakoutWithCustomWidth: any;
15
15
  export declare function calculateBreakoutStyles({ mode, widthStateLineLength, widthStateWidth, }: {
16
16
  mode: BreakoutMarkAttrs['mode'];
17
17
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "96.3.3",
3
+ "version": "96.3.4",
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/"
@@ -153,7 +153,7 @@
153
153
  "@atlaskit/spinner": "^16.3.0",
154
154
  "@atlaskit/task-decision": "^17.11.0",
155
155
  "@atlaskit/textfield": "^6.7.0",
156
- "@atlaskit/tmp-editor-statsig": "^2.23.0",
156
+ "@atlaskit/tmp-editor-statsig": "^2.24.0",
157
157
  "@atlaskit/tokens": "^2.4.0",
158
158
  "@atlaskit/tooltip": "^18.9.0",
159
159
  "@atlaskit/width-detector": "^4.3.0",