@atlaskit/editor-common 86.2.2 → 86.3.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 +20 -0
- package/dist/cjs/link/utils.js +3 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +1 -1
- package/dist/cjs/performance-measures/index.js +46 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/get-performance-options.js +3 -3
- package/dist/cjs/utils/performance/measure.js +12 -0
- package/dist/cjs/with-plugin-state/index.js +3 -2
- package/dist/es2019/link/utils.js +4 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -1
- package/dist/es2019/performance-measures/index.js +38 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/get-performance-options.js +1 -1
- package/dist/es2019/utils/performance/measure.js +12 -0
- package/dist/es2019/with-plugin-state/index.js +2 -1
- package/dist/esm/link/utils.js +3 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -1
- package/dist/esm/performance-measures/index.js +38 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/get-performance-options.js +1 -1
- package/dist/esm/utils/performance/measure.js +12 -0
- package/dist/esm/with-plugin-state/index.js +2 -1
- package/dist/types/link/utils.d.ts +4 -1
- package/dist/types/node-width/index.d.ts +1 -1
- package/dist/types/performance-measures/index.d.ts +3 -0
- package/dist/types/utils/performance/measure.d.ts +9 -0
- package/dist/types-ts4.5/link/utils.d.ts +4 -1
- package/dist/types-ts4.5/node-width/index.d.ts +1 -1
- package/dist/types-ts4.5/performance-measures/index.d.ts +3 -0
- package/dist/types-ts4.5/utils/performance/measure.d.ts +9 -0
- package/package.json +2 -1
- package/performance-measures/package.json +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 86.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#121678](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121678)
|
|
8
|
+
[`9ca02c9c7c5ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9ca02c9c7c5ce) -
|
|
9
|
+
created new entrypoint for startMeasure,stopMeasure,clearMeasure, deprecated those functions in
|
|
10
|
+
editor-common/utils
|
|
11
|
+
|
|
12
|
+
## 86.2.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#121941](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121941)
|
|
17
|
+
[`9db19df977817`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9db19df977817) -
|
|
18
|
+
Added new commands for hyperlink plugin: removeLink and updateLink. These can be used on an active
|
|
19
|
+
link to remove the hyperlink mark or update the text/href on the link.
|
|
20
|
+
- [`3b20c735bc9ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3b20c735bc9ee) -
|
|
21
|
+
[ux] Insert full-width table in comment editor when table resizing is enabled.
|
|
22
|
+
|
|
3
23
|
## 86.2.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/link/utils.js
CHANGED
|
@@ -9,8 +9,9 @@ exports.isTextAtPos = isTextAtPos;
|
|
|
9
9
|
var _atlassianContext = require("@atlaskit/atlassian-context");
|
|
10
10
|
var _constants = require("./constants");
|
|
11
11
|
function isTextAtPos(pos) {
|
|
12
|
-
return function (
|
|
13
|
-
var
|
|
12
|
+
return function (_ref) {
|
|
13
|
+
var tr = _ref.tr;
|
|
14
|
+
var node = tr.doc.nodeAt(pos);
|
|
14
15
|
return !!node && node.isText;
|
|
15
16
|
};
|
|
16
17
|
}
|
|
@@ -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 && Object.prototype.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 = "86.
|
|
20
|
+
var packageVersion = "86.3.0";
|
|
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
|
|
@@ -105,7 +105,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
|
105
105
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
|
|
106
106
|
return isFullWidthModeEnabled ? Math.min(containerWidth.lineLength, _editorSharedStyles.akEditorFullWidthLayoutWidth) : (0, _breakout.absoluteBreakoutWidth)(layout, containerWidth.width);
|
|
107
107
|
};
|
|
108
|
-
var getTableContainerWidth = exports.getTableContainerWidth = function getTableContainerWidth(node) {
|
|
108
|
+
var getTableContainerWidth = exports.getTableContainerWidth = function getTableContainerWidth(node, isCommentEditor) {
|
|
109
109
|
if (node !== null && node !== void 0 && node.attrs.width) {
|
|
110
110
|
return node.attrs.width;
|
|
111
111
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearMeasure = clearMeasure;
|
|
7
|
+
exports.startMeasure = startMeasure;
|
|
8
|
+
exports.stopMeasure = stopMeasure;
|
|
9
|
+
var _isPerformanceApiAvailable = require("../utils/performance/is-performance-api-available");
|
|
10
|
+
var measureMap = new Map();
|
|
11
|
+
function startMeasure(measureName) {
|
|
12
|
+
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
performance.mark("".concat(measureName, "::start"));
|
|
16
|
+
measureMap.set(measureName, performance.now());
|
|
17
|
+
}
|
|
18
|
+
function stopMeasure(measureName, onMeasureComplete) {
|
|
19
|
+
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
performance.mark("".concat(measureName, "::end"));
|
|
23
|
+
var start = onMeasureComplete ? measureMap.get(measureName) : undefined;
|
|
24
|
+
try {
|
|
25
|
+
performance.measure(measureName, "".concat(measureName, "::start"), "".concat(measureName, "::end"));
|
|
26
|
+
} catch (error) {} finally {
|
|
27
|
+
if (onMeasureComplete) {
|
|
28
|
+
var entry = performance.getEntriesByName(measureName).pop();
|
|
29
|
+
if (entry) {
|
|
30
|
+
onMeasureComplete(entry.duration, entry.startTime);
|
|
31
|
+
} else if (start) {
|
|
32
|
+
onMeasureComplete(performance.now() - start, start);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
clearMeasure(measureName);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function clearMeasure(measureName) {
|
|
39
|
+
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
measureMap.delete(measureName);
|
|
43
|
+
performance.clearMarks("".concat(measureName, "::start"));
|
|
44
|
+
performance.clearMarks("".concat(measureName, "::end"));
|
|
45
|
+
performance.clearMeasures(measureName);
|
|
46
|
+
}
|
|
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
|
|
|
20
20
|
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); }; }
|
|
21
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "86.
|
|
23
|
+
var packageVersion = "86.3.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -7,7 +7,7 @@ exports.getPerformanceOptions = getPerformanceOptions;
|
|
|
7
7
|
exports.startMeasureReactNodeViewRendered = startMeasureReactNodeViewRendered;
|
|
8
8
|
exports.stopMeasureReactNodeViewRendered = stopMeasureReactNodeViewRendered;
|
|
9
9
|
var _analytics = require("../analytics");
|
|
10
|
-
var
|
|
10
|
+
var _performanceMeasures = require("../performance-measures");
|
|
11
11
|
// This was existing logic when converting from ReactNodeView
|
|
12
12
|
// our current sampling for this event is not bound by node.type
|
|
13
13
|
var nodeViewRenderedEventsCounter = 0;
|
|
@@ -36,14 +36,14 @@ function getPerformanceOptions(view) {
|
|
|
36
36
|
}
|
|
37
37
|
function startMeasureReactNodeViewRendered(_ref) {
|
|
38
38
|
var nodeTypeName = _ref.nodeTypeName;
|
|
39
|
-
(0,
|
|
39
|
+
(0, _performanceMeasures.startMeasure)("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"));
|
|
40
40
|
}
|
|
41
41
|
function stopMeasureReactNodeViewRendered(_ref2) {
|
|
42
42
|
var nodeTypeName = _ref2.nodeTypeName,
|
|
43
43
|
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
44
44
|
samplingRate = _ref2.samplingRate,
|
|
45
45
|
slowThreshold = _ref2.slowThreshold;
|
|
46
|
-
(0,
|
|
46
|
+
(0, _performanceMeasures.stopMeasure)("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"), function (duration) {
|
|
47
47
|
if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
|
|
48
48
|
dispatchAnalyticsEvent({
|
|
49
49
|
action: _analytics.ACTION.REACT_NODEVIEW_RENDERED,
|
|
@@ -8,6 +8,10 @@ exports.startMeasure = startMeasure;
|
|
|
8
8
|
exports.stopMeasure = stopMeasure;
|
|
9
9
|
var _isPerformanceApiAvailable = require("./is-performance-api-available");
|
|
10
10
|
var measureMap = new Map();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
14
|
+
*/
|
|
11
15
|
function startMeasure(measureName) {
|
|
12
16
|
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
13
17
|
return;
|
|
@@ -15,6 +19,10 @@ function startMeasure(measureName) {
|
|
|
15
19
|
performance.mark("".concat(measureName, "::start"));
|
|
16
20
|
measureMap.set(measureName, performance.now());
|
|
17
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
25
|
+
*/
|
|
18
26
|
function stopMeasure(measureName, onMeasureComplete) {
|
|
19
27
|
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
20
28
|
return;
|
|
@@ -35,6 +43,10 @@ function stopMeasure(measureName, onMeasureComplete) {
|
|
|
35
43
|
clearMeasure(measureName);
|
|
36
44
|
}
|
|
37
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
49
|
+
*/
|
|
38
50
|
function clearMeasure(measureName) {
|
|
39
51
|
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
40
52
|
return;
|
|
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
17
|
var _analytics = require("../analytics");
|
|
18
18
|
var _eventDispatcher = require("../event-dispatcher");
|
|
19
|
+
var _performanceMeasures = require("../performance-measures");
|
|
19
20
|
var _utils = require("../utils");
|
|
20
21
|
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; }
|
|
21
22
|
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; }
|
|
@@ -106,9 +107,9 @@ var WithPluginState = exports.WithPluginState = /*#__PURE__*/function (_React$Co
|
|
|
106
107
|
};
|
|
107
108
|
_this.debounce = debounce(function () {
|
|
108
109
|
var measure = "\uD83E\uDD89".concat(pluginName, "::WithPluginState");
|
|
109
|
-
performanceOptions.trackingEnabled && (0,
|
|
110
|
+
performanceOptions.trackingEnabled && (0, _performanceMeasures.startMeasure)(measure);
|
|
110
111
|
_this.setState(_this.notAppliedState, function () {
|
|
111
|
-
performanceOptions.trackingEnabled && (0,
|
|
112
|
+
performanceOptions.trackingEnabled && (0, _performanceMeasures.stopMeasure)(measure, function (duration) {
|
|
112
113
|
// Each WithPluginState component will fire analytics event no more than once every `samplingLimit` times
|
|
113
114
|
if (++_this.callsCount % performanceOptions.samplingRate === 0 && duration > performanceOptions.slowThreshold) {
|
|
114
115
|
_this.dispatchAnalyticsEvent({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { getATLContextUrl } from '@atlaskit/atlassian-context';
|
|
2
2
|
import { linkPreferencesPath } from './constants';
|
|
3
3
|
export function isTextAtPos(pos) {
|
|
4
|
-
return
|
|
5
|
-
|
|
4
|
+
return ({
|
|
5
|
+
tr
|
|
6
|
+
}) => {
|
|
7
|
+
const node = tr.doc.nodeAt(pos);
|
|
6
8
|
return !!node && node.isText;
|
|
7
9
|
};
|
|
8
10
|
}
|
|
@@ -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 = "86.
|
|
4
|
+
const packageVersion = "86.3.0";
|
|
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
|
|
@@ -100,7 +100,7 @@ const getNestedParentNode = (tablePos, state) => {
|
|
|
100
100
|
const calcBreakoutNodeWidth = (layout, containerWidth, isFullWidthModeEnabled) => {
|
|
101
101
|
return isFullWidthModeEnabled ? Math.min(containerWidth.lineLength, akEditorFullWidthLayoutWidth) : absoluteBreakoutWidth(layout, containerWidth.width);
|
|
102
102
|
};
|
|
103
|
-
export const getTableContainerWidth = node => {
|
|
103
|
+
export const getTableContainerWidth = (node, isCommentEditor) => {
|
|
104
104
|
if (node !== null && node !== void 0 && node.attrs.width) {
|
|
105
105
|
return node.attrs.width;
|
|
106
106
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isPerformanceAPIAvailable } from '../utils/performance/is-performance-api-available';
|
|
2
|
+
const measureMap = new Map();
|
|
3
|
+
export function startMeasure(measureName) {
|
|
4
|
+
if (!isPerformanceAPIAvailable()) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
performance.mark(`${measureName}::start`);
|
|
8
|
+
measureMap.set(measureName, performance.now());
|
|
9
|
+
}
|
|
10
|
+
export function stopMeasure(measureName, onMeasureComplete) {
|
|
11
|
+
if (!isPerformanceAPIAvailable()) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
performance.mark(`${measureName}::end`);
|
|
15
|
+
const start = onMeasureComplete ? measureMap.get(measureName) : undefined;
|
|
16
|
+
try {
|
|
17
|
+
performance.measure(measureName, `${measureName}::start`, `${measureName}::end`);
|
|
18
|
+
} catch (error) {} finally {
|
|
19
|
+
if (onMeasureComplete) {
|
|
20
|
+
const entry = performance.getEntriesByName(measureName).pop();
|
|
21
|
+
if (entry) {
|
|
22
|
+
onMeasureComplete(entry.duration, entry.startTime);
|
|
23
|
+
} else if (start) {
|
|
24
|
+
onMeasureComplete(performance.now() - start, start);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
clearMeasure(measureName);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function clearMeasure(measureName) {
|
|
31
|
+
if (!isPerformanceAPIAvailable()) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
measureMap.delete(measureName);
|
|
35
|
+
performance.clearMarks(`${measureName}::start`);
|
|
36
|
+
performance.clearMarks(`${measureName}::end`);
|
|
37
|
+
performance.clearMeasures(measureName);
|
|
38
|
+
}
|
|
@@ -9,7 +9,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
9
9
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "86.
|
|
12
|
+
const packageVersion = "86.3.0";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
2
|
-
import { startMeasure, stopMeasure } from '
|
|
2
|
+
import { startMeasure, stopMeasure } from '../performance-measures';
|
|
3
3
|
|
|
4
4
|
// This was existing logic when converting from ReactNodeView
|
|
5
5
|
// our current sampling for this event is not bound by node.type
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { isPerformanceAPIAvailable } from './is-performance-api-available';
|
|
2
2
|
const measureMap = new Map();
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
6
|
+
*/
|
|
3
7
|
export function startMeasure(measureName) {
|
|
4
8
|
if (!isPerformanceAPIAvailable()) {
|
|
5
9
|
return;
|
|
@@ -7,6 +11,10 @@ export function startMeasure(measureName) {
|
|
|
7
11
|
performance.mark(`${measureName}::start`);
|
|
8
12
|
measureMap.set(measureName, performance.now());
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
17
|
+
*/
|
|
10
18
|
export function stopMeasure(measureName, onMeasureComplete) {
|
|
11
19
|
if (!isPerformanceAPIAvailable()) {
|
|
12
20
|
return;
|
|
@@ -27,6 +35,10 @@ export function stopMeasure(measureName, onMeasureComplete) {
|
|
|
27
35
|
clearMeasure(measureName);
|
|
28
36
|
}
|
|
29
37
|
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
41
|
+
*/
|
|
30
42
|
export function clearMeasure(measureName) {
|
|
31
43
|
if (!isPerformanceAPIAvailable()) {
|
|
32
44
|
return;
|
|
@@ -3,7 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
5
5
|
import { createDispatch } from '../event-dispatcher';
|
|
6
|
-
import {
|
|
6
|
+
import { startMeasure, stopMeasure } from '../performance-measures';
|
|
7
|
+
import { analyticsEventKey } from '../utils';
|
|
7
8
|
const DEFAULT_SAMPLING_RATE = 100;
|
|
8
9
|
const DEFAULT_SLOW_THRESHOLD = 4;
|
|
9
10
|
|
package/dist/esm/link/utils.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getATLContextUrl } from '@atlaskit/atlassian-context';
|
|
2
2
|
import { linkPreferencesPath } from './constants';
|
|
3
3
|
export function isTextAtPos(pos) {
|
|
4
|
-
return function (
|
|
5
|
-
var
|
|
4
|
+
return function (_ref) {
|
|
5
|
+
var tr = _ref.tr;
|
|
6
|
+
var node = tr.doc.nodeAt(pos);
|
|
6
7
|
return !!node && node.isText;
|
|
7
8
|
};
|
|
8
9
|
}
|
|
@@ -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 = "86.
|
|
10
|
+
var packageVersion = "86.3.0";
|
|
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
|
|
@@ -98,7 +98,7 @@ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
|
98
98
|
var calcBreakoutNodeWidth = function calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled) {
|
|
99
99
|
return isFullWidthModeEnabled ? Math.min(containerWidth.lineLength, akEditorFullWidthLayoutWidth) : absoluteBreakoutWidth(layout, containerWidth.width);
|
|
100
100
|
};
|
|
101
|
-
export var getTableContainerWidth = function getTableContainerWidth(node) {
|
|
101
|
+
export var getTableContainerWidth = function getTableContainerWidth(node, isCommentEditor) {
|
|
102
102
|
if (node !== null && node !== void 0 && node.attrs.width) {
|
|
103
103
|
return node.attrs.width;
|
|
104
104
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isPerformanceAPIAvailable } from '../utils/performance/is-performance-api-available';
|
|
2
|
+
var measureMap = new Map();
|
|
3
|
+
export function startMeasure(measureName) {
|
|
4
|
+
if (!isPerformanceAPIAvailable()) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
performance.mark("".concat(measureName, "::start"));
|
|
8
|
+
measureMap.set(measureName, performance.now());
|
|
9
|
+
}
|
|
10
|
+
export function stopMeasure(measureName, onMeasureComplete) {
|
|
11
|
+
if (!isPerformanceAPIAvailable()) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
performance.mark("".concat(measureName, "::end"));
|
|
15
|
+
var start = onMeasureComplete ? measureMap.get(measureName) : undefined;
|
|
16
|
+
try {
|
|
17
|
+
performance.measure(measureName, "".concat(measureName, "::start"), "".concat(measureName, "::end"));
|
|
18
|
+
} catch (error) {} finally {
|
|
19
|
+
if (onMeasureComplete) {
|
|
20
|
+
var entry = performance.getEntriesByName(measureName).pop();
|
|
21
|
+
if (entry) {
|
|
22
|
+
onMeasureComplete(entry.duration, entry.startTime);
|
|
23
|
+
} else if (start) {
|
|
24
|
+
onMeasureComplete(performance.now() - start, start);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
clearMeasure(measureName);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function clearMeasure(measureName) {
|
|
31
|
+
if (!isPerformanceAPIAvailable()) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
measureMap.delete(measureName);
|
|
35
|
+
performance.clearMarks("".concat(measureName, "::start"));
|
|
36
|
+
performance.clearMarks("".concat(measureName, "::end"));
|
|
37
|
+
performance.clearMeasures(measureName);
|
|
38
|
+
}
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "86.
|
|
20
|
+
var packageVersion = "86.3.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
2
|
-
import { startMeasure, stopMeasure } from '
|
|
2
|
+
import { startMeasure, stopMeasure } from '../performance-measures';
|
|
3
3
|
|
|
4
4
|
// This was existing logic when converting from ReactNodeView
|
|
5
5
|
// our current sampling for this event is not bound by node.type
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { isPerformanceAPIAvailable } from './is-performance-api-available';
|
|
2
2
|
var measureMap = new Map();
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
6
|
+
*/
|
|
3
7
|
export function startMeasure(measureName) {
|
|
4
8
|
if (!isPerformanceAPIAvailable()) {
|
|
5
9
|
return;
|
|
@@ -7,6 +11,10 @@ export function startMeasure(measureName) {
|
|
|
7
11
|
performance.mark("".concat(measureName, "::start"));
|
|
8
12
|
measureMap.set(measureName, performance.now());
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
17
|
+
*/
|
|
10
18
|
export function stopMeasure(measureName, onMeasureComplete) {
|
|
11
19
|
if (!isPerformanceAPIAvailable()) {
|
|
12
20
|
return;
|
|
@@ -27,6 +35,10 @@ export function stopMeasure(measureName, onMeasureComplete) {
|
|
|
27
35
|
clearMeasure(measureName);
|
|
28
36
|
}
|
|
29
37
|
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
41
|
+
*/
|
|
30
42
|
export function clearMeasure(measureName) {
|
|
31
43
|
if (!isPerformanceAPIAvailable()) {
|
|
32
44
|
return;
|
|
@@ -13,7 +13,8 @@ import React from 'react';
|
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
15
15
|
import { createDispatch } from '../event-dispatcher';
|
|
16
|
-
import {
|
|
16
|
+
import { startMeasure, stopMeasure } from '../performance-measures';
|
|
17
|
+
import { analyticsEventKey } from '../utils';
|
|
17
18
|
var DEFAULT_SAMPLING_RATE = 100;
|
|
18
19
|
var DEFAULT_SLOW_THRESHOLD = 4;
|
|
19
20
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Predicate } from '../types';
|
|
2
|
-
export declare function isTextAtPos(pos: number):
|
|
3
|
+
export declare function isTextAtPos(pos: number): (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
}) => boolean;
|
|
3
6
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
4
7
|
export declare const getLinkPreferencesURLFromENV: () => string;
|
|
@@ -11,5 +11,5 @@ export declare const layoutToWidth: {
|
|
|
11
11
|
* If current node selection is not nested will return undefined
|
|
12
12
|
*/
|
|
13
13
|
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => any;
|
|
14
|
-
export declare const getTableContainerWidth: (node?: PMNode) => number;
|
|
14
|
+
export declare const getTableContainerWidth: (node?: PMNode, isCommentEditor?: boolean) => number;
|
|
15
15
|
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
3
|
+
*/
|
|
1
4
|
export declare function startMeasure(measureName: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
7
|
+
*/
|
|
2
8
|
export declare function stopMeasure(measureName: string, onMeasureComplete?: (duration: number, startTime: number) => void): void;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
11
|
+
*/
|
|
3
12
|
export declare function clearMeasure(measureName: string): void;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Predicate } from '../types';
|
|
2
|
-
export declare function isTextAtPos(pos: number):
|
|
3
|
+
export declare function isTextAtPos(pos: number): (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
}) => boolean;
|
|
3
6
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
4
7
|
export declare const getLinkPreferencesURLFromENV: () => string;
|
|
@@ -11,5 +11,5 @@ export declare const layoutToWidth: {
|
|
|
11
11
|
* If current node selection is not nested will return undefined
|
|
12
12
|
*/
|
|
13
13
|
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => any;
|
|
14
|
-
export declare const getTableContainerWidth: (node?: PMNode) => number;
|
|
14
|
+
export declare const getTableContainerWidth: (node?: PMNode, isCommentEditor?: boolean) => number;
|
|
15
15
|
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use 'startMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
3
|
+
*/
|
|
1
4
|
export declare function startMeasure(measureName: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use 'stopMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
7
|
+
*/
|
|
2
8
|
export declare function stopMeasure(measureName: string, onMeasureComplete?: (duration: number, startTime: number) => void): void;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use 'clearMeasure' from '@atlaskit/editor-common/performance-measures'
|
|
11
|
+
*/
|
|
3
12
|
export declare function clearMeasure(measureName: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "86.
|
|
3
|
+
"version": "86.3.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/"
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"./extensibility": "./src/extensibility/index.ts",
|
|
37
37
|
"./normalize-feature-flags": "./src/normalize-feature-flags.ts",
|
|
38
38
|
"./messages": "./src/messages/index.ts",
|
|
39
|
+
"./performance-measures": "./src/performance-measures/index.ts",
|
|
39
40
|
"./provider-factory": "./src/provider-factory.ts",
|
|
40
41
|
"./styles": "./src/styles/index.ts",
|
|
41
42
|
"./validator": "./src/validator.ts",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/performance-measures",
|
|
3
|
+
"main": "../dist/cjs/performance-measures/index.js",
|
|
4
|
+
"module": "../dist/esm/performance-measures/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/performance-measures/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/performance-measures/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/performance-measures/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|