@atlaskit/editor-common 120.16.5 → 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 +53 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/analytics/types/general-events.js +5 -1
- package/dist/cjs/mark/anyMarksActiveFromTr.js +35 -0
- package/dist/cjs/mark/getHadMarkAttributes.js +38 -0
- package/dist/cjs/mark/index.js +14 -0
- 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/cjs/utils/hyperlink.js +9 -5
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/analytics/types/general-events.js +6 -1
- package/dist/es2019/mark/anyMarksActiveFromTr.js +31 -0
- package/dist/es2019/mark/getHadMarkAttributes.js +28 -0
- package/dist/es2019/mark/index.js +2 -0
- 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/es2019/utils/hyperlink.js +5 -2
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/analytics/types/general-events.js +6 -1
- package/dist/esm/mark/anyMarksActiveFromTr.js +30 -0
- package/dist/esm/mark/getHadMarkAttributes.js +32 -0
- package/dist/esm/mark/index.js +2 -0
- 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/esm/utils/hyperlink.js +8 -3
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/format-events.d.ts +1 -0
- package/dist/types/analytics/types/general-events.d.ts +45 -1
- package/dist/types/analytics/types/highlight-events.d.ts +2 -0
- package/dist/types/analytics/types/insert-events.d.ts +1 -0
- package/dist/types/analytics/types/paste-events.d.ts +1 -0
- package/dist/types/mark/anyMarksActiveFromTr.d.ts +6 -0
- package/dist/types/mark/getHadMarkAttributes.d.ts +15 -0
- package/dist/types/mark/index.d.ts +3 -0
- package/dist/types/node-anchor/should-enable-limited-mode.d.ts +4 -2
- package/dist/types/utils/hyperlink.d.ts +2 -1
- package/package.json +6 -6
- package/deprecated-platform-feature-experiments/package.json +0 -10
- package/dist/cjs/platform-feature-experiments/exp-val.js +0 -25
- package/dist/cjs/platform-feature-experiments/index.js +0 -26
- package/dist/cjs/platform-feature-experiments/is-experiment-enabled.js +0 -26
- package/dist/cjs/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -22
- package/dist/es2019/platform-feature-experiments/exp-val.js +0 -19
- package/dist/es2019/platform-feature-experiments/index.js +0 -4
- package/dist/es2019/platform-feature-experiments/is-experiment-enabled.js +0 -20
- package/dist/es2019/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -17
- package/dist/esm/platform-feature-experiments/exp-val.js +0 -19
- package/dist/esm/platform-feature-experiments/index.js +0 -4
- package/dist/esm/platform-feature-experiments/is-experiment-enabled.js +0 -20
- package/dist/esm/platform-feature-experiments/unsafe-exp-val-no-exposure.js +0 -17
- package/dist/types/platform-feature-experiments/exp-val.d.ts +0 -11
- package/dist/types/platform-feature-experiments/index.d.ts +0 -3
- package/dist/types/platform-feature-experiments/is-experiment-enabled.d.ts +0 -11
- package/dist/types/platform-feature-experiments/unsafe-exp-val-no-exposure.d.ts +0 -8
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
// File has been copied to packages/editor/editor-plugin-ai/src/provider/markdown-transformer/utils/hyperlink.ts
|
|
2
5
|
// If changes are made to this file, please make the same update in the linked file.
|
|
3
6
|
|
|
4
7
|
import { linkify } from '@atlaskit/adf-schema/url';
|
|
5
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics/types/enums';
|
|
9
|
+
import { getHadMarkAttributes } from '../mark/getHadMarkAttributes';
|
|
6
10
|
import { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
7
11
|
import { getLinkDomain } from './getLinkDomain';
|
|
8
12
|
import { normalizeUrl } from './normalizeUrl';
|
|
@@ -114,15 +118,16 @@ export var isLinkInMatches = function isLinkInMatches(linkStart, matchesList) {
|
|
|
114
118
|
};
|
|
115
119
|
|
|
116
120
|
// eslint-disable-next-line jsdoc/require-jsdoc, @atlaskit/volt-strict-mode/no-multiple-exports
|
|
117
|
-
export function getLinkCreationAnalyticsEvent(inputMethod, url) {
|
|
121
|
+
export function getLinkCreationAnalyticsEvent(inputMethod, url, tr) {
|
|
122
|
+
var backgroundColor = tr === null || tr === void 0 ? void 0 : tr.doc.type.schema.marks.backgroundColor;
|
|
118
123
|
return {
|
|
119
124
|
action: ACTION.INSERTED,
|
|
120
125
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
121
126
|
actionSubjectId: ACTION_SUBJECT_ID.LINK,
|
|
122
|
-
attributes: {
|
|
127
|
+
attributes: _objectSpread({
|
|
123
128
|
inputMethod: inputMethod,
|
|
124
129
|
fromCurrentDomain: isFromCurrentDomain(url)
|
|
125
|
-
},
|
|
130
|
+
}, tr && backgroundColor ? getHadMarkAttributes(tr, [backgroundColor]) : {}),
|
|
126
131
|
eventType: EVENT_TYPE.TRACK,
|
|
127
132
|
nonPrivacySafeAttributes: {
|
|
128
133
|
linkDomain: getLinkDomain(url)
|
|
@@ -9,6 +9,11 @@ export declare const aiSuggestionsMessages: {
|
|
|
9
9
|
description: string;
|
|
10
10
|
id: string;
|
|
11
11
|
};
|
|
12
|
+
cardAuthorsTooltipLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
12
17
|
cardBadSuggestionLabel: {
|
|
13
18
|
defaultMessage: string;
|
|
14
19
|
description: string;
|
|
@@ -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",
|
|
@@ -44,6 +44,7 @@ type FormatClearAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_CLEAR, {
|
|
|
44
44
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB;
|
|
45
45
|
}>;
|
|
46
46
|
type FormatColorAEP = FormatAEP<ACTION_SUBJECT_ID.FORMAT_COLOR, {
|
|
47
|
+
hadBackgroundColor?: boolean;
|
|
47
48
|
inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.FLOATING_TB;
|
|
48
49
|
newColor: string;
|
|
49
50
|
previousColor: string;
|
|
@@ -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 {};
|
|
@@ -4,6 +4,8 @@ export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED,
|
|
|
4
4
|
inputMethod: INPUT_METHOD;
|
|
5
5
|
}, undefined>;
|
|
6
6
|
export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
|
|
7
|
+
hadLink?: boolean;
|
|
8
|
+
hadTextColor?: boolean;
|
|
7
9
|
inputMethod: INPUT_METHOD;
|
|
8
10
|
newColor: string;
|
|
9
11
|
previousColor: string;
|
|
@@ -94,6 +94,7 @@ type InsertMediaInlineAEP = InsertAEP<ACTION_SUBJECT_ID.MEDIA, {
|
|
|
94
94
|
export type InputMethodInsertLink = INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.CLIPBOARD | INPUT_METHOD.FORMATTING | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.MANUAL;
|
|
95
95
|
type InsertLinkAEP = InsertAEP<ACTION_SUBJECT_ID.LINK, {
|
|
96
96
|
fromCurrentDomain: boolean;
|
|
97
|
+
hadBackgroundColor?: boolean;
|
|
97
98
|
inputMethod: InputMethodInsertLink;
|
|
98
99
|
}, {
|
|
99
100
|
linkDomain: string;
|
|
@@ -17,6 +17,7 @@ type PasteBaseAEP<Action, Attributes, NonPrivacySafeAttributes> = TrackAEP<Actio
|
|
|
17
17
|
type PasteBaseOperationalAEP<Action, Attributes> = OperationalAEP<Action, ACTION_SUBJECT.EDITOR, PASTE_ACTION_SUBJECT_ID, Attributes>;
|
|
18
18
|
type PasteAEP = PasteBaseAEP<ACTION.PASTED, {
|
|
19
19
|
content: PasteContent;
|
|
20
|
+
hadBackgroundColor?: boolean;
|
|
20
21
|
inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
21
22
|
invokedFrom?: string;
|
|
22
23
|
pasteSize: number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Determine which of the given marks exist anywhere in the transaction selection.
|
|
5
|
+
*/
|
|
6
|
+
export declare const anyMarksActiveFromTr: (tr: Transaction | ReadonlyTransaction, markTypes: readonly (Mark | MarkType)[]) => boolean[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
declare const HAD_ATTRIBUTE: {
|
|
4
|
+
readonly backgroundColor: 'hadBackgroundColor';
|
|
5
|
+
readonly link: 'hadLink';
|
|
6
|
+
readonly textColor: 'hadTextColor';
|
|
7
|
+
};
|
|
8
|
+
type MarkName = keyof typeof HAD_ATTRIBUTE;
|
|
9
|
+
export type HadMarkAttribute = (typeof HAD_ATTRIBUTE)[MarkName];
|
|
10
|
+
/**
|
|
11
|
+
* `had*` flags for color / highlight / link apply events.
|
|
12
|
+
* Kill switch `platform_editor_add_text_color_tracking`: gate on, new attributes off.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getHadMarkAttributes: (tr: Transaction | ReadonlyTransaction, markTypes: readonly (MarkType | undefined)[]) => Partial<Record<HadMarkAttribute, boolean>>;
|
|
15
|
+
export {};
|
|
@@ -3,6 +3,9 @@ export { entireSelectionContainsMark } from './entireSelectionContainsMark';
|
|
|
3
3
|
export { filterChildrenBetween } from './filterChildrenBetween';
|
|
4
4
|
export { removeMark } from './removeMark';
|
|
5
5
|
export { anyMarkActive } from './anyMarkActive';
|
|
6
|
+
export { anyMarksActiveFromTr } from './anyMarksActiveFromTr';
|
|
7
|
+
export { getHadMarkAttributes } from './getHadMarkAttributes';
|
|
8
|
+
export type { HadMarkAttribute } from './getHadMarkAttributes';
|
|
6
9
|
export { isMarkAllowedInRange } from './isMarkAllowedInRange';
|
|
7
10
|
export { isMarkExcluded } from './isMarkExcluded';
|
|
8
11
|
export { wholeSelectionHasMarks } from './text-formatting';
|
|
@@ -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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
3
|
import type { AnalyticsEventPayload } from '../analytics/types/events';
|
|
3
4
|
import type { InputMethodInsertLink } from '../analytics/types/insert-events';
|
|
4
5
|
export declare const DONTLINKIFY_REGEXP: RegExp;
|
|
@@ -13,7 +14,7 @@ interface filepathMatch {
|
|
|
13
14
|
}
|
|
14
15
|
export declare const findFilepaths: (text: string, offset?: number) => Array<filepathMatch>;
|
|
15
16
|
export declare const isLinkInMatches: (linkStart: number, matchesList: Array<filepathMatch>) => boolean;
|
|
16
|
-
export declare function getLinkCreationAnalyticsEvent(inputMethod: InputMethodInsertLink, url: string): AnalyticsEventPayload;
|
|
17
|
+
export declare function getLinkCreationAnalyticsEvent(inputMethod: InputMethodInsertLink, url: string, tr?: Transaction | ReadonlyTransaction): AnalyticsEventPayload;
|
|
17
18
|
export { FILEPATH_REGEXP } from './FILEPATH_REGEXP';
|
|
18
19
|
export { LinkMatcher } from './LinkMatcher';
|
|
19
20
|
export { normalizeUrl } from './normalizeUrl';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "121.1.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/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/activity-provider": "^3.1.0",
|
|
32
|
-
"@atlaskit/adf-schema": "^57.
|
|
32
|
+
"@atlaskit/adf-schema": "^57.4.0",
|
|
33
33
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
34
34
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.200.0",
|
|
35
35
|
"@atlaskit/analytics-listeners": "^11.3.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@atlaskit/task-decision": "^21.9.0",
|
|
85
85
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
86
86
|
"@atlaskit/textfield": "^10.2.0",
|
|
87
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
87
|
+
"@atlaskit/tmp-editor-statsig": "^179.0.0",
|
|
88
88
|
"@atlaskit/tokens": "^16.11.0",
|
|
89
89
|
"@atlaskit/tooltip": "^24.3.0",
|
|
90
90
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -146,6 +146,9 @@
|
|
|
146
146
|
"sinon": "^2.2.0"
|
|
147
147
|
},
|
|
148
148
|
"platform-feature-flags": {
|
|
149
|
+
"platform_editor_add_text_color_tracking": {
|
|
150
|
+
"type": "boolean"
|
|
151
|
+
},
|
|
149
152
|
"platform_editor_blocks_patch_7": {
|
|
150
153
|
"type": "boolean",
|
|
151
154
|
"referenceOnly": true
|
|
@@ -165,9 +168,6 @@
|
|
|
165
168
|
"type": "boolean",
|
|
166
169
|
"referenceOnly": true
|
|
167
170
|
},
|
|
168
|
-
"platform_editor_use_new_experiments_api": {
|
|
169
|
-
"type": "boolean"
|
|
170
|
-
},
|
|
171
171
|
"platform_editor_sanitize_selection_fragments": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atlaskit/editor-common/deprecated-platform-feature-experiments",
|
|
3
|
-
"main": "../dist/cjs/platform-feature-experiments/index.js",
|
|
4
|
-
"module": "../dist/esm/platform-feature-experiments/index.js",
|
|
5
|
-
"module:es2019": "../dist/es2019/platform-feature-experiments/index.js",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"**/*.compiled.css"
|
|
8
|
-
],
|
|
9
|
-
"types": "../dist/types/platform-feature-experiments/index.d.ts"
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.expVal = expVal;
|
|
7
|
-
var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for migrating editor experiments to
|
|
13
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
14
|
-
*
|
|
15
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
16
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
17
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
18
|
-
* removed.
|
|
19
|
-
*/
|
|
20
|
-
function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
21
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
22
|
-
return (0, _expVal.expVal)(experimentName, param, defaultValue);
|
|
23
|
-
}
|
|
24
|
-
return legacyValue();
|
|
25
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UNSAFE_expValNoExposure", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _unsafeExpValNoExposure.UNSAFE_expValNoExposure;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "expVal", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _expVal.expVal;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "isExperimentEnabled", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _isExperimentEnabled.isExperimentEnabled;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _expVal = require("./exp-val");
|
|
25
|
-
var _isExperimentEnabled = require("./is-experiment-enabled");
|
|
26
|
-
var _unsafeExpValNoExposure = require("./unsafe-exp-val-no-exposure");
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isExperimentEnabled = isExperimentEnabled;
|
|
7
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
13
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
14
|
-
*
|
|
15
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
16
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
17
|
-
* is evaluated at most once.
|
|
18
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
19
|
-
* transition gate is removed.
|
|
20
|
-
*/
|
|
21
|
-
function isExperimentEnabled(experimentName, legacyValue) {
|
|
22
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
23
|
-
return (0, _isExperimentEnabled.isExperimentEnabled)(experimentName);
|
|
24
|
-
}
|
|
25
|
-
return legacyValue();
|
|
26
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UNSAFE_expValNoExposure = UNSAFE_expValNoExposure;
|
|
7
|
-
var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
|
|
8
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
13
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
14
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
15
|
-
* transition gate is removed.
|
|
16
|
-
*/
|
|
17
|
-
function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
18
|
-
if ((0, _fg.fg)('platform_editor_use_new_experiments_api')) {
|
|
19
|
-
return (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)(experimentName, param, defaultValue);
|
|
20
|
-
}
|
|
21
|
-
return legacyValue();
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { expVal as platformExpVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for migrating editor experiments to
|
|
7
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
8
|
-
*
|
|
9
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
10
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
11
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
12
|
-
* removed.
|
|
13
|
-
*/
|
|
14
|
-
export function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
15
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
16
|
-
return platformExpVal(experimentName, param, defaultValue);
|
|
17
|
-
}
|
|
18
|
-
return legacyValue();
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { isExperimentEnabled as platformIsExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
7
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
8
|
-
*
|
|
9
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
10
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
11
|
-
* is evaluated at most once.
|
|
12
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
13
|
-
* transition gate is removed.
|
|
14
|
-
*/
|
|
15
|
-
export function isExperimentEnabled(experimentName, legacyValue) {
|
|
16
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
17
|
-
return platformIsExperimentEnabled(experimentName);
|
|
18
|
-
}
|
|
19
|
-
return legacyValue();
|
|
20
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
|
|
3
|
-
import { UNSAFE_expValNoExposure as platformUnsafeExpValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
8
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
9
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
10
|
-
* transition gate is removed.
|
|
11
|
-
*/
|
|
12
|
-
export function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
13
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
14
|
-
return platformUnsafeExpValNoExposure(experimentName, param, defaultValue);
|
|
15
|
-
}
|
|
16
|
-
return legacyValue();
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { expVal as platformExpVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for migrating editor experiments to
|
|
7
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
8
|
-
*
|
|
9
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
10
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
11
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
12
|
-
* removed.
|
|
13
|
-
*/
|
|
14
|
-
export function expVal(experimentName, param, defaultValue, legacyValue) {
|
|
15
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
16
|
-
return platformExpVal(experimentName, param, defaultValue);
|
|
17
|
-
}
|
|
18
|
-
return legacyValue();
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
import { isExperimentEnabled as platformIsExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
7
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
8
|
-
*
|
|
9
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
10
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
11
|
-
* is evaluated at most once.
|
|
12
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
13
|
-
* transition gate is removed.
|
|
14
|
-
*/
|
|
15
|
-
export function isExperimentEnabled(experimentName, legacyValue) {
|
|
16
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
17
|
-
return platformIsExperimentEnabled(experimentName);
|
|
18
|
-
}
|
|
19
|
-
return legacyValue();
|
|
20
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/platform/inline-usage -- This temporary strangler intentionally wraps the old and new experiment APIs during migration. */
|
|
2
|
-
|
|
3
|
-
import { UNSAFE_expValNoExposure as platformUnsafeExpValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
8
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
9
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
10
|
-
* transition gate is removed.
|
|
11
|
-
*/
|
|
12
|
-
export function UNSAFE_expValNoExposure(experimentName, param, defaultValue, legacyValue) {
|
|
13
|
-
if (fg('platform_editor_use_new_experiments_api')) {
|
|
14
|
-
return platformUnsafeExpValNoExposure(experimentName, param, defaultValue);
|
|
15
|
-
}
|
|
16
|
-
return legacyValue();
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AssurePrimitives } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
2
|
-
/**
|
|
3
|
-
* Temporary strangler for migrating editor experiments to
|
|
4
|
-
* `@atlaskit/platform-feature-experiments`.
|
|
5
|
-
*
|
|
6
|
-
* The final callback preserves the existing experiment implementation while the migration gate is
|
|
7
|
-
* off. It is evaluated lazily so only one implementation reads the experiment or fires exposure.
|
|
8
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/exp-val` when the transition gate is
|
|
9
|
-
* removed.
|
|
10
|
-
*/
|
|
11
|
-
export declare function expVal<T>(experimentName: string, param: string, defaultValue: T extends true ? never : T, legacyValue: () => AssurePrimitives<T>): AssurePrimitives<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Temporary strangler for boolean editor experiments using the conventional `isEnabled` param.
|
|
3
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
4
|
-
*
|
|
5
|
-
* For experiments with multiple product keys, OR one call per unique product key. Pass the real
|
|
6
|
-
* legacy callback only to the first call and `() => false` to the remaining calls so the fallback
|
|
7
|
-
* is evaluated at most once.
|
|
8
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/is-experiment-enabled` when the
|
|
9
|
-
* transition gate is removed.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isExperimentEnabled(experimentName: string, legacyValue: () => boolean): boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AssurePrimitives } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
2
|
-
/**
|
|
3
|
-
* Temporary strangler for editor experiment reads that intentionally do not fire exposure.
|
|
4
|
-
* The legacy callback is evaluated only while the migration gate is off.
|
|
5
|
-
* Migrate callers to `@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure` when the
|
|
6
|
-
* transition gate is removed.
|
|
7
|
-
*/
|
|
8
|
-
export declare function UNSAFE_expValNoExposure<T>(experimentName: string, param: string, defaultValue: T extends true ? never : T, legacyValue: () => AssurePrimitives<T>): AssurePrimitives<T>;
|