@atlaskit/editor-common 128.3.2 → 129.0.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 +53 -0
- package/block-node-badges/package.json +10 -0
- package/dist/cjs/analytics/types/enums.js +0 -12
- package/dist/cjs/block-node-badges.js +98 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +20 -2
- package/dist/cjs/extensibility/Extension/ExtensionCommentBadge.js +110 -0
- package/dist/cjs/media-single/MediaBadges.js +12 -85
- package/dist/cjs/messages/insert-block.js +0 -5
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/snippetMenuRank.js +35 -0
- package/dist/cjs/quick-insert/utils.js +9 -14
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +0 -13
- package/dist/cjs/react-node-view/index.js +0 -14
- package/dist/cjs/type-ahead/messages.js +0 -10
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +0 -47
- package/dist/es2019/analytics/types/enums.js +0 -12
- package/dist/es2019/block-node-badges.js +84 -0
- package/dist/es2019/extensibility/Extension/Extension/index.js +17 -3
- package/dist/es2019/extensibility/Extension/ExtensionCommentBadge.js +60 -0
- package/dist/es2019/media-single/MediaBadges.js +12 -79
- package/dist/es2019/messages/insert-block.js +0 -5
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/snippetMenuRank.js +30 -0
- package/dist/es2019/quick-insert/utils.js +7 -12
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +1 -15
- package/dist/es2019/react-node-view/index.js +0 -15
- package/dist/es2019/type-ahead/messages.js +0 -10
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +0 -5
- package/dist/esm/analytics/types/enums.js +0 -12
- package/dist/esm/block-node-badges.js +88 -0
- package/dist/esm/extensibility/Extension/Extension/index.js +21 -3
- package/dist/esm/extensibility/Extension/ExtensionCommentBadge.js +101 -0
- package/dist/esm/media-single/MediaBadges.js +12 -82
- package/dist/esm/messages/insert-block.js +0 -5
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/snippetMenuRank.js +29 -0
- package/dist/esm/quick-insert/utils.js +9 -14
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +1 -14
- package/dist/esm/react-node-view/index.js +0 -14
- package/dist/esm/type-ahead/messages.js +0 -10
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/types/analytics/index.d.ts +1 -2
- package/dist/types/analytics/types/enums.d.ts +0 -12
- package/dist/types/analytics/types/events.d.ts +1 -3
- package/dist/types/analytics/types/general-events.d.ts +2 -15
- package/dist/types/block-node-badges.d.ts +14 -0
- package/dist/types/extensibility/Extension/ExtensionCommentBadge.d.ts +8 -0
- package/dist/types/extensibility/types.d.ts +29 -2
- package/dist/types/media-single/MediaBadges.d.ts +4 -8
- package/dist/types/messages/insert-block.d.ts +0 -5
- package/dist/types/quick-insert/snippetMenuRank.d.ts +16 -0
- package/dist/types/type-ahead/messages.d.ts +0 -10
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/performance-tracking.d.ts +0 -22
- package/dist/types/types/type-ahead.d.ts +0 -7
- package/dist/types/utils/index.d.ts +0 -5
- package/package.json +7 -3
- package/quick-insert/snippet-menu-rank/package.json +10 -0
- package/analytics/types/performance-report/package.json +0 -10
- package/dist/cjs/analytics/types/performance-report.js +0 -1
- package/dist/cjs/quick-insert/boost-native-results-above-skills.js +0 -61
- package/dist/cjs/utils/get-performance-options.js +0 -65
- package/dist/cjs/utils/performance/TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.js +0 -10
- package/dist/cjs/utils/performance/TTI_SEVERITY_THRESHOLD_DEFAULTS.js +0 -10
- package/dist/cjs/utils/performance/measure-tti.js +0 -112
- package/dist/cjs/utils/startMeasureReactNodeViewRendered.js +0 -11
- package/dist/es2019/analytics/types/performance-report.js +0 -0
- package/dist/es2019/quick-insert/boost-native-results-above-skills.js +0 -49
- package/dist/es2019/utils/get-performance-options.js +0 -54
- package/dist/es2019/utils/performance/TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.js +0 -4
- package/dist/es2019/utils/performance/TTI_SEVERITY_THRESHOLD_DEFAULTS.js +0 -4
- package/dist/es2019/utils/performance/measure-tti.js +0 -91
- package/dist/es2019/utils/startMeasureReactNodeViewRendered.js +0 -6
- package/dist/esm/analytics/types/performance-report.js +0 -0
- package/dist/esm/quick-insert/boost-native-results-above-skills.js +0 -54
- package/dist/esm/utils/get-performance-options.js +0 -53
- package/dist/esm/utils/performance/TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.js +0 -4
- package/dist/esm/utils/performance/TTI_SEVERITY_THRESHOLD_DEFAULTS.js +0 -4
- package/dist/esm/utils/performance/measure-tti.js +0 -94
- package/dist/esm/utils/startMeasureReactNodeViewRendered.js +0 -5
- package/dist/types/analytics/types/performance-report.d.ts +0 -24
- package/dist/types/quick-insert/boost-native-results-above-skills.d.ts +0 -21
- package/dist/types/utils/get-performance-options.d.ts +0 -14
- package/dist/types/utils/performance/TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.d.ts +0 -4
- package/dist/types/utils/performance/TTI_SEVERITY_THRESHOLD_DEFAULTS.d.ts +0 -4
- package/dist/types/utils/performance/measure-tti.d.ts +0 -8
- package/dist/types/utils/startMeasureReactNodeViewRendered.d.ts +0 -3
- package/performance/measure-tti/package.json +0 -10
- package/utils/get-performance-options/package.json +0 -10
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TTI_SEVERITY_THRESHOLD_DEFAULTS = void 0;
|
|
7
|
-
var TTI_SEVERITY_THRESHOLD_DEFAULTS = exports.TTI_SEVERITY_THRESHOLD_DEFAULTS = {
|
|
8
|
-
NORMAL: 40000,
|
|
9
|
-
DEGRADED: 60000
|
|
10
|
-
};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "TTI_SEVERITY_THRESHOLD_DEFAULTS", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _TTI_SEVERITY_THRESHOLD_DEFAULTS.TTI_SEVERITY_THRESHOLD_DEFAULTS;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
exports.getTTISeverity = getTTISeverity;
|
|
19
|
-
exports.measureTTI = measureTTI;
|
|
20
|
-
var _SEVERITY = require("../SEVERITY");
|
|
21
|
-
var _isPerformanceApiAvailable = require("./is-performance-api-available");
|
|
22
|
-
var _measureRender = require("./measure-render");
|
|
23
|
-
var _TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS = require("./TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS");
|
|
24
|
-
var _TTI_SEVERITY_THRESHOLD_DEFAULTS = require("./TTI_SEVERITY_THRESHOLD_DEFAULTS");
|
|
25
|
-
function measureTTI(onMeasureComplete) {
|
|
26
|
-
var idleThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
27
|
-
var cancelAfter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
|
|
28
|
-
var
|
|
29
|
-
// Dependency Injection for easier testing
|
|
30
|
-
PerfObserver = arguments.length > 3 ? arguments[3] : undefined;
|
|
31
|
-
if (!(0, _isPerformanceApiAvailable.isPerformanceObserverLongTaskAvailable)()) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
var start = performance.now();
|
|
35
|
-
// Keeping track of users moving away from the tab, which distorts the TTI measurement
|
|
36
|
-
var distortedDurationMonitor = (0, _measureRender.getDistortedDurationMonitor)();
|
|
37
|
-
var prevLongTask;
|
|
38
|
-
var lastLongTask = {
|
|
39
|
-
startTime: start,
|
|
40
|
-
duration: 0
|
|
41
|
-
};
|
|
42
|
-
var cancelAfterMs = cancelAfter * 1000;
|
|
43
|
-
var observer = new (PerfObserver || PerformanceObserver)(function (list) {
|
|
44
|
-
var entries = list.getEntries();
|
|
45
|
-
if (entries.length) {
|
|
46
|
-
prevLongTask = lastLongTask;
|
|
47
|
-
lastLongTask = entries[entries.length - 1];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
observer.observe({
|
|
51
|
-
entryTypes: ['longtask']
|
|
52
|
-
});
|
|
53
|
-
var _checkIdle = function checkIdle() {
|
|
54
|
-
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
55
|
-
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
56
|
-
// 3. Several long tasks:
|
|
57
|
-
// 3.1 Interactive from the end of prevLongTask if `lastLongTask.start - prevLongTask.end >= idleThreshold`
|
|
58
|
-
// 3.2 Interactive from the end of lastLongTask if `lastLongTask.start - prevLongTask.end < idleThreshold`
|
|
59
|
-
|
|
60
|
-
var now = performance.now();
|
|
61
|
-
var lastEnd = lastLongTask.startTime + lastLongTask.duration;
|
|
62
|
-
var prevEnd = prevLongTask ? prevLongTask.startTime + prevLongTask.duration : lastEnd;
|
|
63
|
-
var elapsedTimeMs = now - start;
|
|
64
|
-
var canceled = elapsedTimeMs > cancelAfterMs;
|
|
65
|
-
if (!prevLongTask) {
|
|
66
|
-
observer.disconnect();
|
|
67
|
-
distortedDurationMonitor.cleanup();
|
|
68
|
-
return onMeasureComplete(prevEnd, 0, false, distortedDurationMonitor.distortedDuration);
|
|
69
|
-
} else if (lastLongTask.startTime - prevEnd >= idleThreshold) {
|
|
70
|
-
observer.disconnect();
|
|
71
|
-
distortedDurationMonitor.cleanup();
|
|
72
|
-
return onMeasureComplete(prevEnd, prevEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
73
|
-
} else if (now - lastEnd >= idleThreshold || canceled) {
|
|
74
|
-
observer.disconnect();
|
|
75
|
-
distortedDurationMonitor.cleanup();
|
|
76
|
-
return onMeasureComplete(lastEnd, lastEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
77
|
-
}
|
|
78
|
-
return setTimeout(_checkIdle, idleThreshold);
|
|
79
|
-
};
|
|
80
|
-
setTimeout(_checkIdle, idleThreshold);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
84
|
-
function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold) {
|
|
85
|
-
var ttiNormalThreshold = ttiSeverityNormalThreshold || _TTI_SEVERITY_THRESHOLD_DEFAULTS.TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
86
|
-
var ttiDegradedThreshold = ttiSeverityDegradedThreshold || _TTI_SEVERITY_THRESHOLD_DEFAULTS.TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
87
|
-
var ttiSeverity;
|
|
88
|
-
if (tti >= ttiNormalThreshold && tti < ttiDegradedThreshold) {
|
|
89
|
-
ttiSeverity = _SEVERITY.SEVERITY.DEGRADED;
|
|
90
|
-
} else if (tti >= ttiDegradedThreshold) {
|
|
91
|
-
ttiSeverity = _SEVERITY.SEVERITY.BLOCKING;
|
|
92
|
-
} else {
|
|
93
|
-
ttiSeverity = _SEVERITY.SEVERITY.NORMAL;
|
|
94
|
-
}
|
|
95
|
-
var ttiFromInvocationNormalThreshold = ttiFromInvocationSeverityNormalThreshold || _TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
96
|
-
var ttiFromInvocationDegradedThreshold = ttiFromInvocationSeverityDegradedThreshold || _TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
97
|
-
var ttiFromInvocationSeverity;
|
|
98
|
-
if (ttiFromInvocation >= ttiFromInvocationNormalThreshold && ttiFromInvocation < ttiFromInvocationDegradedThreshold) {
|
|
99
|
-
ttiFromInvocationSeverity = _SEVERITY.SEVERITY.DEGRADED;
|
|
100
|
-
} else if (ttiFromInvocation >= ttiFromInvocationDegradedThreshold) {
|
|
101
|
-
ttiFromInvocationSeverity = _SEVERITY.SEVERITY.BLOCKING;
|
|
102
|
-
} else {
|
|
103
|
-
ttiFromInvocationSeverity = _SEVERITY.SEVERITY.NORMAL;
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
ttiSeverity: ttiSeverity,
|
|
107
|
-
ttiFromInvocationSeverity: ttiFromInvocationSeverity
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
111
|
-
|
|
112
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.startMeasureReactNodeViewRendered = startMeasureReactNodeViewRendered;
|
|
7
|
-
var _performanceMeasures = require("../performance-measures");
|
|
8
|
-
function startMeasureReactNodeViewRendered(_ref) {
|
|
9
|
-
var nodeTypeName = _ref.nodeTypeName;
|
|
10
|
-
(0, _performanceMeasures.startMeasure)("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"));
|
|
11
|
-
}
|
|
File without changes
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const SCORE_PROXIMITY_THRESHOLD = 0.2;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The extension type for Rovo skills, used to identify skill items in the
|
|
5
|
-
* quick insert menu. Matches the value defined in
|
|
6
|
-
* @atlassian/conversation-assistant-content-transformer/utils/skills.
|
|
7
|
-
*
|
|
8
|
-
* Intentionally duplicated here to avoid adding a runtime dependency from
|
|
9
|
-
* editor-common to the conversation-assistant packages.
|
|
10
|
-
*/
|
|
11
|
-
const ROVO_SKILL_EXTENSION_TYPE = 'com.atlassian.rovo.skill';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Promotes native editor elements above Rovo skill items in search results
|
|
15
|
-
* when their Fuse scores are close.
|
|
16
|
-
*
|
|
17
|
-
* An item is classified as a Rovo skill when its `extensionType` property
|
|
18
|
-
* (set by `buildMenuItem` for all extension manifest items) matches the
|
|
19
|
-
* Rovo skill extension type. Native editor items (Link, Code snippet, Table,
|
|
20
|
-
* etc.) and other non-Rovo extensions are unaffected, regardless of their
|
|
21
|
-
* priority value.
|
|
22
|
-
*
|
|
23
|
-
* When a skill and a native item have similar scores (within the proximity
|
|
24
|
-
* threshold), the native item is promoted above the skill. But when a skill
|
|
25
|
-
* is a significantly better match (e.g. searching "research" and the skill is
|
|
26
|
-
* "Research Insights" while the native item is "Live search"), the skill keeps
|
|
27
|
-
* its higher rank.
|
|
28
|
-
*/
|
|
29
|
-
export function boostNativeResultsAboveSkills(results) {
|
|
30
|
-
const isSkill = r => r.item.extensionType === ROVO_SKILL_EXTENSION_TYPE;
|
|
31
|
-
const reordered = results.slice(0);
|
|
32
|
-
for (let i = 1; i < reordered.length; i++) {
|
|
33
|
-
if (isSkill(reordered[i])) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
// reordered[i] is a native item — check if there are skills
|
|
37
|
-
// ranked above it that have a similar score.
|
|
38
|
-
let insertAt = i;
|
|
39
|
-
while (insertAt > 0 && isSkill(reordered[insertAt - 1]) && Math.abs(((_reordered$score = reordered[insertAt - 1].score) !== null && _reordered$score !== void 0 ? _reordered$score : 0) - ((_reordered$i$score = reordered[i].score) !== null && _reordered$i$score !== void 0 ? _reordered$i$score : 0)) < SCORE_PROXIMITY_THRESHOLD) {
|
|
40
|
-
var _reordered$score, _reordered$i$score;
|
|
41
|
-
insertAt--;
|
|
42
|
-
}
|
|
43
|
-
if (insertAt < i) {
|
|
44
|
-
const [native] = reordered.splice(i, 1);
|
|
45
|
-
reordered.splice(insertAt, 0, native);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return reordered;
|
|
49
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
2
|
-
import { stopMeasure } from '../performance-measures';
|
|
3
|
-
|
|
4
|
-
// This was existing logic when converting from ReactNodeView
|
|
5
|
-
// our current sampling for this event is not bound by node.type
|
|
6
|
-
let nodeViewRenderedEventsCounter = 0;
|
|
7
|
-
const DEFAULT_SAMPLING_RATE = 100;
|
|
8
|
-
const DEFAULT_SLOW_THRESHOLD = 7;
|
|
9
|
-
export function getPerformanceOptions(view) {
|
|
10
|
-
var _nodeViewTracking$sam, _nodeViewTracking$slo;
|
|
11
|
-
// Please, do not copy or use this kind of code below
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
const fakePluginKey = {
|
|
14
|
-
key: 'analyticsPlugin$',
|
|
15
|
-
getState: state => {
|
|
16
|
-
// Ignored via go/ees005
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
return state['analyticsPlugin$'];
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const pluginState = fakePluginKey.getState(view.state);
|
|
22
|
-
const nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
23
|
-
const samplingRate = (_nodeViewTracking$sam = nodeViewTracking.samplingRate) !== null && _nodeViewTracking$sam !== void 0 ? _nodeViewTracking$sam : DEFAULT_SAMPLING_RATE;
|
|
24
|
-
const slowThreshold = (_nodeViewTracking$slo = nodeViewTracking.slowThreshold) !== null && _nodeViewTracking$slo !== void 0 ? _nodeViewTracking$slo : DEFAULT_SLOW_THRESHOLD;
|
|
25
|
-
return {
|
|
26
|
-
trackingEnabled: !!nodeViewTracking.enabled,
|
|
27
|
-
samplingRate,
|
|
28
|
-
slowThreshold
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
33
|
-
export function stopMeasureReactNodeViewRendered({
|
|
34
|
-
nodeTypeName,
|
|
35
|
-
dispatchAnalyticsEvent,
|
|
36
|
-
samplingRate,
|
|
37
|
-
slowThreshold
|
|
38
|
-
}) {
|
|
39
|
-
stopMeasure(`🦉${nodeTypeName}::ReactNodeView`, duration => {
|
|
40
|
-
if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
|
|
41
|
-
dispatchAnalyticsEvent({
|
|
42
|
-
action: ACTION.REACT_NODEVIEW_RENDERED,
|
|
43
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
44
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
45
|
-
attributes: {
|
|
46
|
-
node: nodeTypeName,
|
|
47
|
-
duration
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
54
|
-
export { startMeasureReactNodeViewRendered } from './startMeasureReactNodeViewRendered';
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { SEVERITY } from '../SEVERITY';
|
|
2
|
-
import { isPerformanceObserverLongTaskAvailable } from './is-performance-api-available';
|
|
3
|
-
import { getDistortedDurationMonitor } from './measure-render';
|
|
4
|
-
import { TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS';
|
|
5
|
-
import { TTI_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_SEVERITY_THRESHOLD_DEFAULTS';
|
|
6
|
-
export function measureTTI(onMeasureComplete, idleThreshold = 1000, cancelAfter = 60,
|
|
7
|
-
// Dependency Injection for easier testing
|
|
8
|
-
PerfObserver) {
|
|
9
|
-
if (!isPerformanceObserverLongTaskAvailable()) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const start = performance.now();
|
|
13
|
-
// Keeping track of users moving away from the tab, which distorts the TTI measurement
|
|
14
|
-
const distortedDurationMonitor = getDistortedDurationMonitor();
|
|
15
|
-
let prevLongTask;
|
|
16
|
-
let lastLongTask = {
|
|
17
|
-
startTime: start,
|
|
18
|
-
duration: 0
|
|
19
|
-
};
|
|
20
|
-
const cancelAfterMs = cancelAfter * 1000;
|
|
21
|
-
const observer = new (PerfObserver || PerformanceObserver)(list => {
|
|
22
|
-
const entries = list.getEntries();
|
|
23
|
-
if (entries.length) {
|
|
24
|
-
prevLongTask = lastLongTask;
|
|
25
|
-
lastLongTask = entries[entries.length - 1];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
observer.observe({
|
|
29
|
-
entryTypes: ['longtask']
|
|
30
|
-
});
|
|
31
|
-
const checkIdle = () => {
|
|
32
|
-
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
33
|
-
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
34
|
-
// 3. Several long tasks:
|
|
35
|
-
// 3.1 Interactive from the end of prevLongTask if `lastLongTask.start - prevLongTask.end >= idleThreshold`
|
|
36
|
-
// 3.2 Interactive from the end of lastLongTask if `lastLongTask.start - prevLongTask.end < idleThreshold`
|
|
37
|
-
|
|
38
|
-
const now = performance.now();
|
|
39
|
-
const lastEnd = lastLongTask.startTime + lastLongTask.duration;
|
|
40
|
-
const prevEnd = prevLongTask ? prevLongTask.startTime + prevLongTask.duration : lastEnd;
|
|
41
|
-
const elapsedTimeMs = now - start;
|
|
42
|
-
const canceled = elapsedTimeMs > cancelAfterMs;
|
|
43
|
-
if (!prevLongTask) {
|
|
44
|
-
observer.disconnect();
|
|
45
|
-
distortedDurationMonitor.cleanup();
|
|
46
|
-
return onMeasureComplete(prevEnd, 0, false, distortedDurationMonitor.distortedDuration);
|
|
47
|
-
} else if (lastLongTask.startTime - prevEnd >= idleThreshold) {
|
|
48
|
-
observer.disconnect();
|
|
49
|
-
distortedDurationMonitor.cleanup();
|
|
50
|
-
return onMeasureComplete(prevEnd, prevEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
51
|
-
} else if (now - lastEnd >= idleThreshold || canceled) {
|
|
52
|
-
observer.disconnect();
|
|
53
|
-
distortedDurationMonitor.cleanup();
|
|
54
|
-
return onMeasureComplete(lastEnd, lastEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
55
|
-
}
|
|
56
|
-
return setTimeout(checkIdle, idleThreshold);
|
|
57
|
-
};
|
|
58
|
-
setTimeout(checkIdle, idleThreshold);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
62
|
-
export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold) {
|
|
63
|
-
const ttiNormalThreshold = ttiSeverityNormalThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
64
|
-
const ttiDegradedThreshold = ttiSeverityDegradedThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
65
|
-
let ttiSeverity;
|
|
66
|
-
if (tti >= ttiNormalThreshold && tti < ttiDegradedThreshold) {
|
|
67
|
-
ttiSeverity = SEVERITY.DEGRADED;
|
|
68
|
-
} else if (tti >= ttiDegradedThreshold) {
|
|
69
|
-
ttiSeverity = SEVERITY.BLOCKING;
|
|
70
|
-
} else {
|
|
71
|
-
ttiSeverity = SEVERITY.NORMAL;
|
|
72
|
-
}
|
|
73
|
-
const ttiFromInvocationNormalThreshold = ttiFromInvocationSeverityNormalThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
74
|
-
const ttiFromInvocationDegradedThreshold = ttiFromInvocationSeverityDegradedThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
75
|
-
let ttiFromInvocationSeverity;
|
|
76
|
-
if (ttiFromInvocation >= ttiFromInvocationNormalThreshold && ttiFromInvocation < ttiFromInvocationDegradedThreshold) {
|
|
77
|
-
ttiFromInvocationSeverity = SEVERITY.DEGRADED;
|
|
78
|
-
} else if (ttiFromInvocation >= ttiFromInvocationDegradedThreshold) {
|
|
79
|
-
ttiFromInvocationSeverity = SEVERITY.BLOCKING;
|
|
80
|
-
} else {
|
|
81
|
-
ttiFromInvocationSeverity = SEVERITY.NORMAL;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
ttiSeverity,
|
|
85
|
-
ttiFromInvocationSeverity
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
89
|
-
export { TTI_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_SEVERITY_THRESHOLD_DEFAULTS';
|
|
90
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
91
|
-
export { TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS';
|
|
File without changes
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
var SCORE_PROXIMITY_THRESHOLD = 0.2;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The extension type for Rovo skills, used to identify skill items in the
|
|
6
|
-
* quick insert menu. Matches the value defined in
|
|
7
|
-
* @atlassian/conversation-assistant-content-transformer/utils/skills.
|
|
8
|
-
*
|
|
9
|
-
* Intentionally duplicated here to avoid adding a runtime dependency from
|
|
10
|
-
* editor-common to the conversation-assistant packages.
|
|
11
|
-
*/
|
|
12
|
-
var ROVO_SKILL_EXTENSION_TYPE = 'com.atlassian.rovo.skill';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Promotes native editor elements above Rovo skill items in search results
|
|
16
|
-
* when their Fuse scores are close.
|
|
17
|
-
*
|
|
18
|
-
* An item is classified as a Rovo skill when its `extensionType` property
|
|
19
|
-
* (set by `buildMenuItem` for all extension manifest items) matches the
|
|
20
|
-
* Rovo skill extension type. Native editor items (Link, Code snippet, Table,
|
|
21
|
-
* etc.) and other non-Rovo extensions are unaffected, regardless of their
|
|
22
|
-
* priority value.
|
|
23
|
-
*
|
|
24
|
-
* When a skill and a native item have similar scores (within the proximity
|
|
25
|
-
* threshold), the native item is promoted above the skill. But when a skill
|
|
26
|
-
* is a significantly better match (e.g. searching "research" and the skill is
|
|
27
|
-
* "Research Insights" while the native item is "Live search"), the skill keeps
|
|
28
|
-
* its higher rank.
|
|
29
|
-
*/
|
|
30
|
-
export function boostNativeResultsAboveSkills(results) {
|
|
31
|
-
var isSkill = function isSkill(r) {
|
|
32
|
-
return r.item.extensionType === ROVO_SKILL_EXTENSION_TYPE;
|
|
33
|
-
};
|
|
34
|
-
var reordered = results.slice(0);
|
|
35
|
-
for (var i = 1; i < reordered.length; i++) {
|
|
36
|
-
if (isSkill(reordered[i])) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
// reordered[i] is a native item — check if there are skills
|
|
40
|
-
// ranked above it that have a similar score.
|
|
41
|
-
var insertAt = i;
|
|
42
|
-
while (insertAt > 0 && isSkill(reordered[insertAt - 1]) && Math.abs(((_reordered$score = reordered[insertAt - 1].score) !== null && _reordered$score !== void 0 ? _reordered$score : 0) - ((_reordered$i$score = reordered[i].score) !== null && _reordered$i$score !== void 0 ? _reordered$i$score : 0)) < SCORE_PROXIMITY_THRESHOLD) {
|
|
43
|
-
var _reordered$score, _reordered$i$score;
|
|
44
|
-
insertAt--;
|
|
45
|
-
}
|
|
46
|
-
if (insertAt < i) {
|
|
47
|
-
var _reordered$splice = reordered.splice(i, 1),
|
|
48
|
-
_reordered$splice2 = _slicedToArray(_reordered$splice, 1),
|
|
49
|
-
native = _reordered$splice2[0];
|
|
50
|
-
reordered.splice(insertAt, 0, native);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return reordered;
|
|
54
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
2
|
-
import { stopMeasure } from '../performance-measures';
|
|
3
|
-
|
|
4
|
-
// This was existing logic when converting from ReactNodeView
|
|
5
|
-
// our current sampling for this event is not bound by node.type
|
|
6
|
-
var nodeViewRenderedEventsCounter = 0;
|
|
7
|
-
var DEFAULT_SAMPLING_RATE = 100;
|
|
8
|
-
var DEFAULT_SLOW_THRESHOLD = 7;
|
|
9
|
-
export function getPerformanceOptions(view) {
|
|
10
|
-
var _nodeViewTracking$sam, _nodeViewTracking$slo;
|
|
11
|
-
// Please, do not copy or use this kind of code below
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
var fakePluginKey = {
|
|
14
|
-
key: 'analyticsPlugin$',
|
|
15
|
-
getState: function getState(state) {
|
|
16
|
-
// Ignored via go/ees005
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
return state['analyticsPlugin$'];
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var pluginState = fakePluginKey.getState(view.state);
|
|
22
|
-
var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
|
|
23
|
-
var samplingRate = (_nodeViewTracking$sam = nodeViewTracking.samplingRate) !== null && _nodeViewTracking$sam !== void 0 ? _nodeViewTracking$sam : DEFAULT_SAMPLING_RATE;
|
|
24
|
-
var slowThreshold = (_nodeViewTracking$slo = nodeViewTracking.slowThreshold) !== null && _nodeViewTracking$slo !== void 0 ? _nodeViewTracking$slo : DEFAULT_SLOW_THRESHOLD;
|
|
25
|
-
return {
|
|
26
|
-
trackingEnabled: !!nodeViewTracking.enabled,
|
|
27
|
-
samplingRate: samplingRate,
|
|
28
|
-
slowThreshold: slowThreshold
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
33
|
-
export function stopMeasureReactNodeViewRendered(_ref) {
|
|
34
|
-
var nodeTypeName = _ref.nodeTypeName,
|
|
35
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
36
|
-
samplingRate = _ref.samplingRate,
|
|
37
|
-
slowThreshold = _ref.slowThreshold;
|
|
38
|
-
stopMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"), function (duration) {
|
|
39
|
-
if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
|
|
40
|
-
dispatchAnalyticsEvent({
|
|
41
|
-
action: ACTION.REACT_NODEVIEW_RENDERED,
|
|
42
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
43
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
44
|
-
attributes: {
|
|
45
|
-
node: nodeTypeName,
|
|
46
|
-
duration: duration
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
53
|
-
export { startMeasureReactNodeViewRendered } from './startMeasureReactNodeViewRendered';
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { SEVERITY } from '../SEVERITY';
|
|
2
|
-
import { isPerformanceObserverLongTaskAvailable } from './is-performance-api-available';
|
|
3
|
-
import { getDistortedDurationMonitor } from './measure-render';
|
|
4
|
-
import { TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS';
|
|
5
|
-
import { TTI_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_SEVERITY_THRESHOLD_DEFAULTS';
|
|
6
|
-
export function measureTTI(onMeasureComplete) {
|
|
7
|
-
var idleThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
8
|
-
var cancelAfter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
|
|
9
|
-
var
|
|
10
|
-
// Dependency Injection for easier testing
|
|
11
|
-
PerfObserver = arguments.length > 3 ? arguments[3] : undefined;
|
|
12
|
-
if (!isPerformanceObserverLongTaskAvailable()) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
var start = performance.now();
|
|
16
|
-
// Keeping track of users moving away from the tab, which distorts the TTI measurement
|
|
17
|
-
var distortedDurationMonitor = getDistortedDurationMonitor();
|
|
18
|
-
var prevLongTask;
|
|
19
|
-
var lastLongTask = {
|
|
20
|
-
startTime: start,
|
|
21
|
-
duration: 0
|
|
22
|
-
};
|
|
23
|
-
var cancelAfterMs = cancelAfter * 1000;
|
|
24
|
-
var observer = new (PerfObserver || PerformanceObserver)(function (list) {
|
|
25
|
-
var entries = list.getEntries();
|
|
26
|
-
if (entries.length) {
|
|
27
|
-
prevLongTask = lastLongTask;
|
|
28
|
-
lastLongTask = entries[entries.length - 1];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
observer.observe({
|
|
32
|
-
entryTypes: ['longtask']
|
|
33
|
-
});
|
|
34
|
-
var _checkIdle = function checkIdle() {
|
|
35
|
-
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
36
|
-
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
37
|
-
// 3. Several long tasks:
|
|
38
|
-
// 3.1 Interactive from the end of prevLongTask if `lastLongTask.start - prevLongTask.end >= idleThreshold`
|
|
39
|
-
// 3.2 Interactive from the end of lastLongTask if `lastLongTask.start - prevLongTask.end < idleThreshold`
|
|
40
|
-
|
|
41
|
-
var now = performance.now();
|
|
42
|
-
var lastEnd = lastLongTask.startTime + lastLongTask.duration;
|
|
43
|
-
var prevEnd = prevLongTask ? prevLongTask.startTime + prevLongTask.duration : lastEnd;
|
|
44
|
-
var elapsedTimeMs = now - start;
|
|
45
|
-
var canceled = elapsedTimeMs > cancelAfterMs;
|
|
46
|
-
if (!prevLongTask) {
|
|
47
|
-
observer.disconnect();
|
|
48
|
-
distortedDurationMonitor.cleanup();
|
|
49
|
-
return onMeasureComplete(prevEnd, 0, false, distortedDurationMonitor.distortedDuration);
|
|
50
|
-
} else if (lastLongTask.startTime - prevEnd >= idleThreshold) {
|
|
51
|
-
observer.disconnect();
|
|
52
|
-
distortedDurationMonitor.cleanup();
|
|
53
|
-
return onMeasureComplete(prevEnd, prevEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
54
|
-
} else if (now - lastEnd >= idleThreshold || canceled) {
|
|
55
|
-
observer.disconnect();
|
|
56
|
-
distortedDurationMonitor.cleanup();
|
|
57
|
-
return onMeasureComplete(lastEnd, lastEnd - start, canceled, distortedDurationMonitor.distortedDuration);
|
|
58
|
-
}
|
|
59
|
-
return setTimeout(_checkIdle, idleThreshold);
|
|
60
|
-
};
|
|
61
|
-
setTimeout(_checkIdle, idleThreshold);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
65
|
-
export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold) {
|
|
66
|
-
var ttiNormalThreshold = ttiSeverityNormalThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
67
|
-
var ttiDegradedThreshold = ttiSeverityDegradedThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
68
|
-
var ttiSeverity;
|
|
69
|
-
if (tti >= ttiNormalThreshold && tti < ttiDegradedThreshold) {
|
|
70
|
-
ttiSeverity = SEVERITY.DEGRADED;
|
|
71
|
-
} else if (tti >= ttiDegradedThreshold) {
|
|
72
|
-
ttiSeverity = SEVERITY.BLOCKING;
|
|
73
|
-
} else {
|
|
74
|
-
ttiSeverity = SEVERITY.NORMAL;
|
|
75
|
-
}
|
|
76
|
-
var ttiFromInvocationNormalThreshold = ttiFromInvocationSeverityNormalThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
77
|
-
var ttiFromInvocationDegradedThreshold = ttiFromInvocationSeverityDegradedThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
78
|
-
var ttiFromInvocationSeverity;
|
|
79
|
-
if (ttiFromInvocation >= ttiFromInvocationNormalThreshold && ttiFromInvocation < ttiFromInvocationDegradedThreshold) {
|
|
80
|
-
ttiFromInvocationSeverity = SEVERITY.DEGRADED;
|
|
81
|
-
} else if (ttiFromInvocation >= ttiFromInvocationDegradedThreshold) {
|
|
82
|
-
ttiFromInvocationSeverity = SEVERITY.BLOCKING;
|
|
83
|
-
} else {
|
|
84
|
-
ttiFromInvocationSeverity = SEVERITY.NORMAL;
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
ttiSeverity: ttiSeverity,
|
|
88
|
-
ttiFromInvocationSeverity: ttiFromInvocationSeverity
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
92
|
-
export { TTI_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_SEVERITY_THRESHOLD_DEFAULTS';
|
|
93
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
94
|
-
export { TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS } from './TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface PluginMethodReport {
|
|
2
|
-
onEditorViewStateUpdated: number;
|
|
3
|
-
stateApply: number;
|
|
4
|
-
viewUpdate: number;
|
|
5
|
-
}
|
|
6
|
-
export interface PluginsReport {
|
|
7
|
-
[name: string]: PluginMethodReport;
|
|
8
|
-
}
|
|
9
|
-
export type NodeCount = Record<string, number>;
|
|
10
|
-
export interface PluginPerformanceReportData {
|
|
11
|
-
duration: number;
|
|
12
|
-
extensionNodes: NodeCount;
|
|
13
|
-
nodes: NodeCount;
|
|
14
|
-
plugins: PluginsReport;
|
|
15
|
-
slowPlugins: PluginsReport;
|
|
16
|
-
stepDurations: {
|
|
17
|
-
countNodes: number;
|
|
18
|
-
onChange: number;
|
|
19
|
-
onEditorViewStateUpdated: number;
|
|
20
|
-
stateApply: number;
|
|
21
|
-
viewUpdate: number;
|
|
22
|
-
};
|
|
23
|
-
trigger: string;
|
|
24
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { QuickInsertItem } from '../provider-factory';
|
|
2
|
-
/**
|
|
3
|
-
* Promotes native editor elements above Rovo skill items in search results
|
|
4
|
-
* when their Fuse scores are close.
|
|
5
|
-
*
|
|
6
|
-
* An item is classified as a Rovo skill when its `extensionType` property
|
|
7
|
-
* (set by `buildMenuItem` for all extension manifest items) matches the
|
|
8
|
-
* Rovo skill extension type. Native editor items (Link, Code snippet, Table,
|
|
9
|
-
* etc.) and other non-Rovo extensions are unaffected, regardless of their
|
|
10
|
-
* priority value.
|
|
11
|
-
*
|
|
12
|
-
* When a skill and a native item have similar scores (within the proximity
|
|
13
|
-
* threshold), the native item is promoted above the skill. But when a skill
|
|
14
|
-
* is a significantly better match (e.g. searching "research" and the skill is
|
|
15
|
-
* "Research Insights" while the native item is "Live search"), the skill keeps
|
|
16
|
-
* its higher rank.
|
|
17
|
-
*/
|
|
18
|
-
export declare function boostNativeResultsAboveSkills<T extends {
|
|
19
|
-
item: QuickInsertItem;
|
|
20
|
-
score?: number;
|
|
21
|
-
}>(results: T[]): T[];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { AnalyticsEventPayload } from '../analytics';
|
|
3
|
-
export declare function getPerformanceOptions(view: EditorView): {
|
|
4
|
-
samplingRate: number;
|
|
5
|
-
slowThreshold: number;
|
|
6
|
-
trackingEnabled: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function stopMeasureReactNodeViewRendered({ nodeTypeName, dispatchAnalyticsEvent, samplingRate, slowThreshold, }: {
|
|
9
|
-
dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
|
|
10
|
-
nodeTypeName: string;
|
|
11
|
-
samplingRate: number;
|
|
12
|
-
slowThreshold: number;
|
|
13
|
-
}): void;
|
|
14
|
-
export { startMeasureReactNodeViewRendered } from './startMeasureReactNodeViewRendered';
|