@atlaskit/editor-common 121.0.0 → 121.1.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 +32 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/analytics/types/general-events.js +5 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-anchor/should-enable-limited-mode.js +5 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/analytics/types/general-events.js +6 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-anchor/should-enable-limited-mode.js +4 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/analytics/types/general-events.js +6 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-anchor/should-enable-limited-mode.js +5 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/general-events.d.ts +45 -1
- package/dist/types/node-anchor/should-enable-limited-mode.d.ts +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 121.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`aec3fcfe13ff9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aec3fcfe13ff9) -
|
|
8
|
+
EDITOR-8303 Add runtime input-latency trigger for limited mode behind
|
|
9
|
+
platform_editor_dynamic_limited_mode. Limited mode can now latch mid-session when sustained slow
|
|
10
|
+
input or repeated browser freezes indicate the device is struggling, in addition to the existing
|
|
11
|
+
document-size decision. The latch is one-way. Nothing is constructed when the experiment is off.
|
|
12
|
+
|
|
13
|
+
How much evidence is needed is a single tunable, `requiredConfirmations`: that many qualifying
|
|
14
|
+
windows, each separated from the last by `confirmationGapMs`. The hardware no longer feeds into
|
|
15
|
+
the decision — `navigator.hardwareConcurrency` and `navigator.deviceMemory` are reported with the
|
|
16
|
+
`limitedModeLatched` event instead, so which devices latch can be answered from the data rather
|
|
17
|
+
than assumed up front.
|
|
18
|
+
|
|
19
|
+
`LimitedModePluginState` gains a derived `enabled` flag, which is now the single thing consumers
|
|
20
|
+
should branch on — the individual reasons (`documentSizeBreachesThreshold`, `latchPolicyBreached`)
|
|
21
|
+
no longer need to be combined at each call site, so a future reason needs no change outside this
|
|
22
|
+
plugin. `sharedState.enabled` reads from it.
|
|
23
|
+
|
|
24
|
+
Under the experiment the document decision is also evaluated on load and on document replacement
|
|
25
|
+
only, rather than on every transaction that changes the document. That check walks the whole
|
|
26
|
+
document, so it was a full-document scan per keystroke on exactly the pages least able to afford
|
|
27
|
+
one. The trade-off is that a document editing its way past the thresholds is not re-judged until
|
|
28
|
+
it next loads.
|
|
29
|
+
|
|
30
|
+
Consumers updated to react to a mid-session change: table sticky headers now subscribe instead of
|
|
31
|
+
reading once at construction, block-controls resets rather than freezes its state on entry, and
|
|
32
|
+
the expand, media and table nodeviews read the derived flag so they no longer miss a runtime
|
|
33
|
+
latch.
|
|
34
|
+
|
|
3
35
|
## 121.0.0
|
|
4
36
|
|
|
5
37
|
### Major Changes
|
|
@@ -95,6 +95,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
95
95
|
/** used in @atlassian/editor-referentiality */
|
|
96
96
|
ACTION["GOT_CONNECTIONS"] = "gotConnections";
|
|
97
97
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
98
|
+
ACTION["LIMITED_MODE_LATCHED"] = "limitedModeLatched";
|
|
98
99
|
ACTION["LANGUAGE_AUTO_DETECTED"] = "languageAutoDetected";
|
|
99
100
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
100
101
|
ACTION["MATCHED"] = "matched";
|
|
@@ -26,4 +26,8 @@ var BROWSER_FREEZE_INTERACTION_TYPE = exports.BROWSER_FREEZE_INTERACTION_TYPE =
|
|
|
26
26
|
BROWSER_FREEZE_INTERACTION_TYPE["CLICKING"] = "clicking";
|
|
27
27
|
BROWSER_FREEZE_INTERACTION_TYPE["PASTING"] = "pasting";
|
|
28
28
|
return BROWSER_FREEZE_INTERACTION_TYPE;
|
|
29
|
-
}({});
|
|
29
|
+
}({});
|
|
30
|
+
/**
|
|
31
|
+
* Fired when the runtime performance detector decides the device is struggling badly enough to
|
|
32
|
+
* warrant limited mode.
|
|
33
|
+
*/
|
|
@@ -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 = "
|
|
30
|
+
var packageVersion = "121.0.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -20,16 +20,17 @@ var LEGACY_CONTENT_EXTENSION_KEY = 'legacy-content';
|
|
|
20
20
|
* 2. the document contains a legacy-content macro (LCM)
|
|
21
21
|
* 3. node count exceeds the node-count threshold
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* Thresholds default to `getLimitedModeThresholds()` but can be passed in, which is how the
|
|
24
|
+
* limited-mode plugin's latch policy supplies them from its own config. That default is where the
|
|
24
25
|
* `platform_editor_limited_threshold_tweaks` cohort is resolved — see
|
|
25
26
|
* `limited-mode-document-thresholds.ts` for the values and the data behind them.
|
|
26
27
|
*
|
|
27
28
|
* Performance: doc size is checked first so an oversized document skips the traversal entirely.
|
|
28
29
|
*/
|
|
29
30
|
var shouldEnableLimitedModeForDocument = exports.shouldEnableLimitedModeForDocument = function shouldEnableLimitedModeForDocument(doc) {
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
nodeCountThreshold =
|
|
31
|
+
var thresholds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _limitedModeDocumentThresholds.getLimitedModeThresholds)();
|
|
32
|
+
var docSizeThreshold = thresholds.docSizeThreshold,
|
|
33
|
+
nodeCountThreshold = thresholds.nodeCountThreshold;
|
|
33
34
|
if (doc.nodeSize > docSizeThreshold) {
|
|
34
35
|
return true;
|
|
35
36
|
}
|
|
@@ -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 = "
|
|
27
|
+
var packageVersion = "121.0.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -91,6 +91,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
91
91
|
/** used in @atlassian/editor-referentiality */
|
|
92
92
|
ACTION["GOT_CONNECTIONS"] = "gotConnections";
|
|
93
93
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
94
|
+
ACTION["LIMITED_MODE_LATCHED"] = "limitedModeLatched";
|
|
94
95
|
ACTION["LANGUAGE_AUTO_DETECTED"] = "languageAutoDetected";
|
|
95
96
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
96
97
|
ACTION["MATCHED"] = "matched";
|
|
@@ -26,4 +26,9 @@ export let BROWSER_FREEZE_INTERACTION_TYPE = /*#__PURE__*/function (BROWSER_FREE
|
|
|
26
26
|
BROWSER_FREEZE_INTERACTION_TYPE["CLICKING"] = "clicking";
|
|
27
27
|
BROWSER_FREEZE_INTERACTION_TYPE["PASTING"] = "pasting";
|
|
28
28
|
return BROWSER_FREEZE_INTERACTION_TYPE;
|
|
29
|
-
}({});
|
|
29
|
+
}({});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Fired when the runtime performance detector decides the device is struggling badly enough to
|
|
33
|
+
* warrant limited mode.
|
|
34
|
+
*/
|
|
@@ -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 = "
|
|
16
|
+
const packageVersion = "121.0.0";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -14,17 +14,18 @@ const LEGACY_CONTENT_EXTENSION_KEY = 'legacy-content';
|
|
|
14
14
|
* 2. the document contains a legacy-content macro (LCM)
|
|
15
15
|
* 3. node count exceeds the node-count threshold
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* Thresholds default to `getLimitedModeThresholds()` but can be passed in, which is how the
|
|
18
|
+
* limited-mode plugin's latch policy supplies them from its own config. That default is where the
|
|
18
19
|
* `platform_editor_limited_threshold_tweaks` cohort is resolved — see
|
|
19
20
|
* `limited-mode-document-thresholds.ts` for the values and the data behind them.
|
|
20
21
|
*
|
|
21
22
|
* Performance: doc size is checked first so an oversized document skips the traversal entirely.
|
|
22
23
|
*/
|
|
23
|
-
export const shouldEnableLimitedModeForDocument = doc => {
|
|
24
|
+
export const shouldEnableLimitedModeForDocument = (doc, thresholds = getLimitedModeThresholds()) => {
|
|
24
25
|
const {
|
|
25
26
|
docSizeThreshold,
|
|
26
27
|
nodeCountThreshold
|
|
27
|
-
} =
|
|
28
|
+
} = thresholds;
|
|
28
29
|
if (doc.nodeSize > docSizeThreshold) {
|
|
29
30
|
return true;
|
|
30
31
|
}
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "121.0.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -91,6 +91,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
91
91
|
/** used in @atlassian/editor-referentiality */
|
|
92
92
|
ACTION["GOT_CONNECTIONS"] = "gotConnections";
|
|
93
93
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
94
|
+
ACTION["LIMITED_MODE_LATCHED"] = "limitedModeLatched";
|
|
94
95
|
ACTION["LANGUAGE_AUTO_DETECTED"] = "languageAutoDetected";
|
|
95
96
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
96
97
|
ACTION["MATCHED"] = "matched";
|
|
@@ -26,4 +26,9 @@ export var BROWSER_FREEZE_INTERACTION_TYPE = /*#__PURE__*/function (BROWSER_FREE
|
|
|
26
26
|
BROWSER_FREEZE_INTERACTION_TYPE["CLICKING"] = "clicking";
|
|
27
27
|
BROWSER_FREEZE_INTERACTION_TYPE["PASTING"] = "pasting";
|
|
28
28
|
return BROWSER_FREEZE_INTERACTION_TYPE;
|
|
29
|
-
}({});
|
|
29
|
+
}({});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Fired when the runtime performance detector decides the device is struggling badly enough to
|
|
33
|
+
* warrant limited mode.
|
|
34
|
+
*/
|
|
@@ -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 = "
|
|
22
|
+
var packageVersion = "121.0.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -14,16 +14,17 @@ var LEGACY_CONTENT_EXTENSION_KEY = 'legacy-content';
|
|
|
14
14
|
* 2. the document contains a legacy-content macro (LCM)
|
|
15
15
|
* 3. node count exceeds the node-count threshold
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* Thresholds default to `getLimitedModeThresholds()` but can be passed in, which is how the
|
|
18
|
+
* limited-mode plugin's latch policy supplies them from its own config. That default is where the
|
|
18
19
|
* `platform_editor_limited_threshold_tweaks` cohort is resolved — see
|
|
19
20
|
* `limited-mode-document-thresholds.ts` for the values and the data behind them.
|
|
20
21
|
*
|
|
21
22
|
* Performance: doc size is checked first so an oversized document skips the traversal entirely.
|
|
22
23
|
*/
|
|
23
24
|
export var shouldEnableLimitedModeForDocument = function shouldEnableLimitedModeForDocument(doc) {
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
nodeCountThreshold =
|
|
25
|
+
var thresholds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getLimitedModeThresholds();
|
|
26
|
+
var docSizeThreshold = thresholds.docSizeThreshold,
|
|
27
|
+
nodeCountThreshold = thresholds.nodeCountThreshold;
|
|
27
28
|
if (doc.nodeSize > docSizeThreshold) {
|
|
28
29
|
return true;
|
|
29
30
|
}
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "121.0.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -88,6 +88,7 @@ export declare enum ACTION {
|
|
|
88
88
|
/** used in @atlassian/editor-referentiality */
|
|
89
89
|
GOT_CONNECTIONS = "gotConnections",
|
|
90
90
|
LANGUAGE_SELECTED = "languageSelected",
|
|
91
|
+
LIMITED_MODE_LATCHED = "limitedModeLatched",
|
|
91
92
|
LANGUAGE_AUTO_DETECTED = "languageAutoDetected",
|
|
92
93
|
LIST_ITEM_JOINED = "listItemJoined",
|
|
93
94
|
MATCHED = "matched",
|
|
@@ -71,6 +71,50 @@ type SlowInputAEP = OperationalAEPWithObjectId<ACTION.SLOW_INPUT, ACTION_SUBJECT
|
|
|
71
71
|
nodeSize: number;
|
|
72
72
|
time: number;
|
|
73
73
|
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Fired when the runtime performance detector decides the device is struggling badly enough to
|
|
76
|
+
* warrant limited mode.
|
|
77
|
+
*/
|
|
78
|
+
type LimitedModeLatchedAEP = OperationalAEPWithObjectId<ACTION.LIMITED_MODE_LATCHED, ACTION_SUBJECT.EDITOR, undefined, {
|
|
79
|
+
/**
|
|
80
|
+
* `navigator.deviceMemory` in GB. Reported for correlation only — the hardware does not feed
|
|
81
|
+
* into the decision. Absent outside Chromium, which does not expose the hint.
|
|
82
|
+
*/
|
|
83
|
+
deviceMemoryGb?: number;
|
|
84
|
+
/** Whether the document was already breaching its thresholds when the runtime bar was met. */
|
|
85
|
+
documentAlreadyBreached: boolean;
|
|
86
|
+
/** Which criterion closed the first qualifying window. */
|
|
87
|
+
firstWindowReason: string;
|
|
88
|
+
/** `navigator.hardwareConcurrency`, i.e. logical cores. Reported for correlation only. */
|
|
89
|
+
hardwareConcurrency?: number;
|
|
90
|
+
/** Whether limited mode was actually applied, i.e. whether the session is in the treatment. */
|
|
91
|
+
latched: boolean;
|
|
92
|
+
/** Median of the closing keystroke window, present only when `reason` is `inputLatency`. */
|
|
93
|
+
latencyMedianMs?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Elapsed time from the first qualifying window to the latch, spanning every confirmation gap
|
|
96
|
+
* that was waited out. `0` when a single window latched.
|
|
97
|
+
*/
|
|
98
|
+
msFromFirstWindow?: number;
|
|
99
|
+
nodeSize: number;
|
|
100
|
+
/**
|
|
101
|
+
* Which criterion closed the window that latched — `inputLatency`, `freeze` or `forced`.
|
|
102
|
+
* Together with `firstWindowReason` this shows whether one signal latched on its own or two
|
|
103
|
+
* different ones agreed.
|
|
104
|
+
*/
|
|
105
|
+
reason: string;
|
|
106
|
+
/** How many qualifying windows this session required, i.e. the bar that was met. */
|
|
107
|
+
requiredConfirmations: number;
|
|
108
|
+
/** Milliseconds from the detector starting to the bar being met. */
|
|
109
|
+
timeToLatch: number;
|
|
110
|
+
/**
|
|
111
|
+
* Cumulative counts for the whole session, never reset by a qualifying window — so these show
|
|
112
|
+
* how much evidence accrued overall, not just in the window that happened to close.
|
|
113
|
+
*/
|
|
114
|
+
totalFreezes: number;
|
|
115
|
+
totalInputSamples: number;
|
|
116
|
+
totalSlowInputs: number;
|
|
117
|
+
}>;
|
|
74
118
|
type InputPerfSamplingAEP = OperationalAEPWithObjectId<ACTION.INPUT_PERF_SAMPLING, ACTION_SUBJECT.EDITOR, undefined, {
|
|
75
119
|
nodeCount?: Record<string, number>;
|
|
76
120
|
nodeSize: number;
|
|
@@ -267,5 +311,5 @@ type ChangeToneMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR
|
|
|
267
311
|
type TranslateMenuItemClickedAEP = UIAEP<ACTION.CLICKED, ACTION_SUBJECT.TOOLBAR_DROPDOWN_MENU_ITEM, ACTION_SUBJECT_ID.AI_TRANSLATE, {
|
|
268
312
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
|
|
269
313
|
}>;
|
|
270
|
-
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertTabViewedAEP | PickerMediaInsertImageGenerationSubmittedAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageAutoDetectedAEP | CodeBlockLanguageSelectedAEP | CodeBlockFormatCodeSuccessAEP | CodeBlockFormatCodeFailedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockFoldingToggleAEP | CodeBlockWordWrapToggleAEP | CodeBlockLineNumbersToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | AIRemixButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
314
|
+
export type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | AnnotationErrorAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ButtonUploadMediaAEP | ColorPickerAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamplingAEP | InputPerfSamplingAvgAEP | LimitedModeLatchedAEP | PickerEmojiAEP | PickerImageAEP | PickerMediaInsertAEP | PickerMediaInsertTabViewedAEP | PickerMediaInsertImageGenerationSubmittedAEP | PickerMediaInsertClosedAEP | PickerMediaInsertCancelledAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | TransactionMutatedAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageAutoDetectedAEP | CodeBlockLanguageSelectedAEP | CodeBlockFormatCodeSuccessAEP | CodeBlockFormatCodeFailedAEP | EditorContentRetrievalPerformedAEP | MediaLinkTransformedAEP | TextLinkCodeMarkTransformedAEP | DedupeMarksTransformedAEP | IndentationMarksTransformedAEP | NodesMissingContentTransformedAEP | InvalidProsemirrorDocumentErrorAEP | DocumentProcessingErrorAEP | InvalidMediaContentTransformedAEP | HeadingAnchorLinkButtonAEP | CollabStepsTrackerPayloadAEP | CollabOrganicChangesTrackerPayloadAEP | BlocksDragInitAEP | CodeBlockFoldingToggleAEP | CodeBlockWordWrapToggleAEP | CodeBlockLineNumbersToggleAEP | RequestToEditAEP | SingleColumLayoutDetectedAEP | CopyLinkToAnchorButtonAEP | DockedPrimaryToolbarRenderedAEP | RovoMoreOptionsClickedAEP | AskRovoButtonClickedAEP | SmartLinkRovoButtonClickedAEP | SmartLinkSummarizeButtonClickedAEP | AIRemixButtonClickedAEP | ChangeToneMenuItemClickedAEP | TranslateMenuItemClickedAEP | MediaSingleWidthTransformedAEP;
|
|
271
315
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { LimitedModeThresholds } from './limited-mode-document-thresholds';
|
|
2
3
|
/**
|
|
3
4
|
* Single source of truth for the limited (performance) mode decision.
|
|
4
5
|
*
|
|
@@ -12,10 +13,11 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
12
13
|
* 2. the document contains a legacy-content macro (LCM)
|
|
13
14
|
* 3. node count exceeds the node-count threshold
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
+
* Thresholds default to `getLimitedModeThresholds()` but can be passed in, which is how the
|
|
17
|
+
* limited-mode plugin's latch policy supplies them from its own config. That default is where the
|
|
16
18
|
* `platform_editor_limited_threshold_tweaks` cohort is resolved — see
|
|
17
19
|
* `limited-mode-document-thresholds.ts` for the values and the data behind them.
|
|
18
20
|
*
|
|
19
21
|
* Performance: doc size is checked first so an oversized document skips the traversal entirely.
|
|
20
22
|
*/
|
|
21
|
-
export declare const shouldEnableLimitedModeForDocument: (doc: PMNode) => boolean;
|
|
23
|
+
export declare const shouldEnableLimitedModeForDocument: (doc: PMNode, thresholds?: LimitedModeThresholds) => boolean;
|
package/package.json
CHANGED