@atlaskit/editor-core 198.7.0 → 199.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 +24 -0
- package/dist/cjs/composable-editor/core-editor.js +3 -14
- package/dist/cjs/composable-editor/hooks/useMeasureEditorMountTime.js +2 -10
- package/dist/cjs/composable-editor/utils/sendDurationAnalytics.js +3 -13
- package/dist/cjs/create-editor/ErrorBoundary.js +3 -27
- package/dist/cjs/create-editor/ReactEditorView.js +1 -59
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/create-editor/feature-flags-from-props.js +2 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +3 -14
- package/dist/es2019/composable-editor/hooks/useMeasureEditorMountTime.js +2 -10
- package/dist/es2019/composable-editor/utils/sendDurationAnalytics.js +1 -11
- package/dist/es2019/create-editor/ErrorBoundary.js +1 -26
- package/dist/es2019/create-editor/ReactEditorView.js +2 -60
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/create-editor/feature-flags-from-props.js +2 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +3 -14
- package/dist/esm/composable-editor/hooks/useMeasureEditorMountTime.js +2 -10
- package/dist/esm/composable-editor/utils/sendDurationAnalytics.js +3 -13
- package/dist/esm/create-editor/ErrorBoundary.js +3 -27
- package/dist/esm/create-editor/ReactEditorView.js +2 -60
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/create-editor/feature-flags-from-props.js +2 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/hooks/useMeasureEditorMountTime.d.ts +1 -3
- package/dist/types/composable-editor/utils/sendDurationAnalytics.d.ts +1 -3
- package/dist/types/create-editor/ErrorBoundary.d.ts +0 -3
- package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
- package/dist/types/presets/default.d.ts +20 -20
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/composable-editor/hooks/useMeasureEditorMountTime.d.ts +1 -3
- package/dist/types-ts4.5/composable-editor/utils/sendDurationAnalytics.d.ts +1 -3
- package/dist/types-ts4.5/create-editor/ErrorBoundary.d.ts +0 -3
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +0 -3
- package/dist/types-ts4.5/presets/default.d.ts +20 -20
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +17 -9
|
@@ -12,7 +12,6 @@ import { measureRender } from '@atlaskit/editor-common/performance/measure-rende
|
|
|
12
12
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
13
13
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
14
14
|
import { processRawValue, processRawValueWithoutTransformation } from '@atlaskit/editor-common/process-raw-value';
|
|
15
|
-
import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
|
|
16
15
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
17
16
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
17
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -25,7 +24,7 @@ import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
|
25
24
|
import measurements from '../utils/performance/measure-enum';
|
|
26
25
|
import { PluginPerformanceObserver } from '../utils/performance/plugin-performance-observer';
|
|
27
26
|
import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
|
|
28
|
-
import {
|
|
27
|
+
import { EVENT_NAME_ON_CHANGE } from '../utils/performance/track-transactions';
|
|
29
28
|
import { validateNodes, validNode } from '../utils/validateNodes';
|
|
30
29
|
import { PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD } from './consts';
|
|
31
30
|
import { createErrorReporter, createPMPlugins, processPluginsList } from './create-editor';
|
|
@@ -260,7 +259,6 @@ export class ReactEditorView extends React.Component {
|
|
|
260
259
|
if (!this.view) {
|
|
261
260
|
return;
|
|
262
261
|
}
|
|
263
|
-
startMeasure(EVENT_NAME_DISPATCH_TRANSACTION);
|
|
264
262
|
const nodes = findChangedNodesFromTransaction(unsafeTransaction);
|
|
265
263
|
const changedNodesValid = validateNodes(nodes);
|
|
266
264
|
const transaction = new Proxy(unsafeTransaction, freezeUnsafeTransactionProperties({
|
|
@@ -271,39 +269,24 @@ export class ReactEditorView extends React.Component {
|
|
|
271
269
|
const oldEditorState = this.view.state;
|
|
272
270
|
|
|
273
271
|
// go ahead and update the state now we know the transaction is good
|
|
274
|
-
startMeasure(EVENT_NAME_STATE_APPLY);
|
|
275
272
|
const {
|
|
276
273
|
state: editorState,
|
|
277
274
|
transactions
|
|
278
275
|
} = this.view.state.applyTransaction(transaction);
|
|
279
|
-
stopMeasure(EVENT_NAME_STATE_APPLY, (duration, startTime) => {
|
|
280
|
-
var _this$experienceStore;
|
|
281
|
-
(_this$experienceStore = this.experienceStore) === null || _this$experienceStore === void 0 ? void 0 : _this$experienceStore.mark(EditorExperience.interaction, 'stateApply', startTime + duration);
|
|
282
|
-
});
|
|
283
276
|
if (editorState === oldEditorState) {
|
|
284
277
|
return;
|
|
285
278
|
}
|
|
286
|
-
startMeasure(EVENT_NAME_UPDATE_STATE);
|
|
287
279
|
this.view.updateState(editorState);
|
|
288
|
-
stopMeasure(EVENT_NAME_UPDATE_STATE, (duration, startTime) => {
|
|
289
|
-
var _this$experienceStore2;
|
|
290
|
-
(_this$experienceStore2 = this.experienceStore) === null || _this$experienceStore2 === void 0 ? void 0 : _this$experienceStore2.mark(EditorExperience.interaction, 'viewUpdateState', startTime + duration);
|
|
291
|
-
});
|
|
292
280
|
this.pluginInjectionAPI.onEditorViewUpdated({
|
|
293
281
|
newEditorState: editorState,
|
|
294
282
|
oldEditorState
|
|
295
283
|
});
|
|
296
|
-
startMeasure(EVENT_NAME_VIEW_STATE_UPDATED);
|
|
297
284
|
this.onEditorViewStateUpdated({
|
|
298
285
|
originalTransaction: transaction,
|
|
299
286
|
transactions,
|
|
300
287
|
oldEditorState,
|
|
301
288
|
newEditorState: editorState
|
|
302
289
|
});
|
|
303
|
-
stopMeasure(EVENT_NAME_VIEW_STATE_UPDATED, (duration, startTime) => {
|
|
304
|
-
var _this$experienceStore3;
|
|
305
|
-
(_this$experienceStore3 = this.experienceStore) === null || _this$experienceStore3 === void 0 ? void 0 : _this$experienceStore3.mark(EditorExperience.interaction, 'onEditorViewStateUpdated', startTime + duration);
|
|
306
|
-
});
|
|
307
290
|
if (this.props.editorProps.onChange && transaction.docChanged) {
|
|
308
291
|
const source = transaction.getMeta('isRemote') ? 'remote' : 'local';
|
|
309
292
|
startMeasure(EVENT_NAME_ON_CHANGE);
|
|
@@ -311,8 +294,6 @@ export class ReactEditorView extends React.Component {
|
|
|
311
294
|
source
|
|
312
295
|
});
|
|
313
296
|
stopMeasure(EVENT_NAME_ON_CHANGE, (duration, startTime) => {
|
|
314
|
-
var _this$experienceStore4;
|
|
315
|
-
(_this$experienceStore4 = this.experienceStore) === null || _this$experienceStore4 === void 0 ? void 0 : _this$experienceStore4.mark(EditorExperience.interaction, 'onChange', startTime + duration);
|
|
316
297
|
this.dispatchAnalyticsEvent({
|
|
317
298
|
action: ACTION.ON_CHANGE_CALLBACK,
|
|
318
299
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -325,11 +306,6 @@ export class ReactEditorView extends React.Component {
|
|
|
325
306
|
});
|
|
326
307
|
}
|
|
327
308
|
this.editorState = editorState;
|
|
328
|
-
stopMeasure(EVENT_NAME_DISPATCH_TRANSACTION, (duration, startTime) => {
|
|
329
|
-
var _this$experienceStore5, _this$experienceStore6;
|
|
330
|
-
(_this$experienceStore5 = this.experienceStore) === null || _this$experienceStore5 === void 0 ? void 0 : _this$experienceStore5.mark(EditorExperience.interaction, 'dispatchTransaction', startTime + duration);
|
|
331
|
-
(_this$experienceStore6 = this.experienceStore) === null || _this$experienceStore6 === void 0 ? void 0 : _this$experienceStore6.success(EditorExperience.interaction);
|
|
332
|
-
});
|
|
333
309
|
} else {
|
|
334
310
|
const invalidNodes = nodes.filter(node => !validNode(node)).map(node => getDocStructure(node, {
|
|
335
311
|
compact: true
|
|
@@ -371,7 +347,7 @@ export class ReactEditorView extends React.Component {
|
|
|
371
347
|
}) => {
|
|
372
348
|
this.proseMirrorRenderedSeverity = getAnalyticsEventSeverity(duration, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD);
|
|
373
349
|
if (this.view) {
|
|
374
|
-
var _this$pluginInjection4
|
|
350
|
+
var _this$pluginInjection4;
|
|
375
351
|
const nodes = getNodesCount(this.view.state.doc);
|
|
376
352
|
const ttfb = getResponseEndTime();
|
|
377
353
|
const contextIdentifier = (_this$pluginInjection4 = this.pluginInjectionAPI.api().base) === null || _this$pluginInjection4 === void 0 ? void 0 : _this$pluginInjection4.sharedState.currentState();
|
|
@@ -389,14 +365,6 @@ export class ReactEditorView extends React.Component {
|
|
|
389
365
|
},
|
|
390
366
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
391
367
|
});
|
|
392
|
-
if (!distortedDuration) {
|
|
393
|
-
var _this$experienceStore7;
|
|
394
|
-
(_this$experienceStore7 = this.experienceStore) === null || _this$experienceStore7 === void 0 ? void 0 : _this$experienceStore7.mark(EditorExperience.loadEditor, ACTION.PROSEMIRROR_RENDERED, startTime + duration);
|
|
395
|
-
}
|
|
396
|
-
(_this$experienceStore8 = this.experienceStore) === null || _this$experienceStore8 === void 0 ? void 0 : _this$experienceStore8.addMetadata(EditorExperience.loadEditor, {
|
|
397
|
-
nodes,
|
|
398
|
-
ttfb
|
|
399
|
-
});
|
|
400
368
|
}
|
|
401
369
|
});
|
|
402
370
|
|
|
@@ -423,32 +391,6 @@ export class ReactEditorView extends React.Component {
|
|
|
423
391
|
if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
424
392
|
this.focusTimeoutId = handleEditorFocus(view);
|
|
425
393
|
}
|
|
426
|
-
if (this.featureFlags.ufo) {
|
|
427
|
-
this.experienceStore = ExperienceStore.getInstance(view);
|
|
428
|
-
this.experienceStore.start(EditorExperience.editSession);
|
|
429
|
-
this.experienceStore.addMetadata(EditorExperience.editSession, {
|
|
430
|
-
reliabilityInterval: RELIABILITY_INTERVAL
|
|
431
|
-
});
|
|
432
|
-
this.reliabilityInterval = window.setInterval(() => {
|
|
433
|
-
var _this$experienceStore9, _this$experienceStore10;
|
|
434
|
-
(_this$experienceStore9 = this.experienceStore) === null || _this$experienceStore9 === void 0 ? void 0 : (_this$experienceStore10 = _this$experienceStore9.success(EditorExperience.editSession)) === null || _this$experienceStore10 === void 0 ? void 0 : _this$experienceStore10.finally(() => {
|
|
435
|
-
var _this$experienceStore11, _this$experienceStore12;
|
|
436
|
-
(_this$experienceStore11 = this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : _this$experienceStore11.start(EditorExperience.editSession);
|
|
437
|
-
(_this$experienceStore12 = this.experienceStore) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.addMetadata(EditorExperience.editSession, {
|
|
438
|
-
reliabilityInterval: RELIABILITY_INTERVAL
|
|
439
|
-
});
|
|
440
|
-
});
|
|
441
|
-
const reliabilityEvent = {
|
|
442
|
-
action: ACTION.UFO_SESSION_COMPLETE,
|
|
443
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
444
|
-
attributes: {
|
|
445
|
-
interval: RELIABILITY_INTERVAL
|
|
446
|
-
},
|
|
447
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
448
|
-
};
|
|
449
|
-
this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
450
|
-
}, RELIABILITY_INTERVAL);
|
|
451
|
-
}
|
|
452
394
|
|
|
453
395
|
// Force React to re-render so consumers get a reference to the editor view
|
|
454
396
|
this.forceUpdate();
|
|
@@ -35,8 +35,7 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
35
35
|
},
|
|
36
36
|
base: {
|
|
37
37
|
allowInlineCursorTarget: true,
|
|
38
|
-
allowScrollGutter: getScrollGutterOptions(props)
|
|
39
|
-
ufo: createFeatureFlagsFromProps(props).ufo
|
|
38
|
+
allowScrollGutter: getScrollGutterOptions(props)
|
|
40
39
|
},
|
|
41
40
|
blockType: {
|
|
42
41
|
lastNodeMustBeParagraph: appearance === 'comment' || appearance === 'chromeless',
|
|
@@ -21,7 +21,7 @@ function getSpellCheck(featureFlags) {
|
|
|
21
21
|
* which is used by both current and archv3 editors.
|
|
22
22
|
*/
|
|
23
23
|
export function createFeatureFlagsFromProps(props) {
|
|
24
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$
|
|
24
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$collabEdit, _props$collabEdit2;
|
|
25
25
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
26
26
|
return {
|
|
27
27
|
...normalizedFeatureFlags,
|
|
@@ -31,8 +31,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
31
31
|
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags5 = props.featureFlags) === null || _props$featureFlags5 === void 0 ? void 0 : _props$featureFlags5.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.synchronyErrorDocStructure) : false),
|
|
32
32
|
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.enableViewUpdateSubscription) : false),
|
|
33
33
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.collabAvatarScroll) : false),
|
|
34
|
-
|
|
35
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
34
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.twoLineEditorToolbar) : false),
|
|
36
35
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
37
36
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
|
|
38
37
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "
|
|
2
|
+
export const version = "199.0.0";
|
|
@@ -13,7 +13,6 @@ import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-con
|
|
|
13
13
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
14
14
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
16
|
-
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
17
16
|
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
|
|
18
17
|
import EditorActions from '../actions';
|
|
19
18
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
@@ -40,16 +39,11 @@ function Editor(passedProps) {
|
|
|
40
39
|
return new EditorActions();
|
|
41
40
|
}, []);
|
|
42
41
|
var editorActions = editorContext.editorActions || editorActionsPlaceholderInstance;
|
|
43
|
-
var startTime = useRef(performance.now());
|
|
44
42
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
45
43
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
46
|
-
var experienceStore = useRef();
|
|
47
44
|
var handleAnalyticsEvent = useCallback(function (data) {
|
|
48
45
|
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
49
46
|
}, [createAnalyticsEvent]);
|
|
50
|
-
var getExperienceStore = useCallback(function () {
|
|
51
|
-
return experienceStore.current;
|
|
52
|
-
}, []);
|
|
53
47
|
var getFeatureFlagsFromRef = useCallback(function () {
|
|
54
48
|
return createFeatureFlagsFromProps(propsRef.current);
|
|
55
49
|
}, []);
|
|
@@ -59,20 +53,15 @@ function Editor(passedProps) {
|
|
|
59
53
|
onEditorReady = _propsRef$current.onEditorReady,
|
|
60
54
|
featureFlags = _propsRef$current.featureFlags;
|
|
61
55
|
editorActions._privateRegisterEditor(instance.view, instance.eventDispatcher, instance.transformer, getFeatureFlagsFromRef);
|
|
62
|
-
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.ufo) {
|
|
63
|
-
var _experienceStore$curr;
|
|
64
|
-
experienceStore.current = ExperienceStore.getInstance(instance.view);
|
|
65
|
-
(_experienceStore$curr = experienceStore.current) === null || _experienceStore$curr === void 0 || _experienceStore$curr.start(EditorExperience.loadEditor, startTime.current);
|
|
66
|
-
}
|
|
67
56
|
if (onEditorReady) {
|
|
68
57
|
startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
69
58
|
onEditorReady(editorActions);
|
|
70
59
|
stopMeasure(measurements.ON_EDITOR_READY_CALLBACK, sendDurationAnalytics(ACTION.ON_EDITOR_READY_CALLBACK, {
|
|
71
60
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
72
61
|
featureFlags: featureFlags
|
|
73
|
-
},
|
|
62
|
+
}, createAnalyticsEvent));
|
|
74
63
|
}
|
|
75
|
-
}, [editorActions, createAnalyticsEvent, getFeatureFlagsFromRef, propsRef
|
|
64
|
+
}, [editorActions, createAnalyticsEvent, getFeatureFlagsFromRef, propsRef]);
|
|
76
65
|
var onEditorDestroyed = useCallback(function (_instance) {
|
|
77
66
|
var onDestroy = propsRef.current.onDestroy;
|
|
78
67
|
editorActions._privateUnregisterEditor();
|
|
@@ -80,7 +69,7 @@ function Editor(passedProps) {
|
|
|
80
69
|
onDestroy();
|
|
81
70
|
}
|
|
82
71
|
}, [editorActions, propsRef]);
|
|
83
|
-
useMeasureEditorMountTime(props,
|
|
72
|
+
useMeasureEditorMountTime(props, createAnalyticsEvent);
|
|
84
73
|
var providerFactory = useProviderFactory(props, editorActions, createAnalyticsEvent);
|
|
85
74
|
var onSaveFromProps = props.onSave;
|
|
86
75
|
var handleSave = useCallback(function (view) {
|
|
@@ -15,23 +15,15 @@ import useEditorConstructor from './useEditorMeasuresConstructor';
|
|
|
15
15
|
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
16
16
|
*
|
|
17
17
|
* @param props EditorProps
|
|
18
|
-
* @param getExperienceStore function to retrieve the Editor's current ExperienceStore
|
|
19
18
|
* @param createAnalyticsEvent
|
|
20
19
|
*/
|
|
21
|
-
export default function useMeasureEditorMountTime(props,
|
|
20
|
+
export default function useMeasureEditorMountTime(props, createAnalyticsEvent) {
|
|
22
21
|
useEditorConstructor();
|
|
23
22
|
useEffect(function () {
|
|
24
|
-
stopMeasure(measurements.EDITOR_MOUNTED, sendDurationAnalytics(ACTION.EDITOR_MOUNTED, props,
|
|
23
|
+
stopMeasure(measurements.EDITOR_MOUNTED, sendDurationAnalytics(ACTION.EDITOR_MOUNTED, props, createAnalyticsEvent));
|
|
25
24
|
return function () {
|
|
26
|
-
var _props$featureFlags;
|
|
27
25
|
clearMeasure(measurements.EDITOR_MOUNTED);
|
|
28
26
|
clearMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
29
|
-
if ((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.ufo) {
|
|
30
|
-
var _getExperienceStore;
|
|
31
|
-
(_getExperienceStore = getExperienceStore()) === null || _getExperienceStore === void 0 || _getExperienceStore.abortAll({
|
|
32
|
-
reason: 'editor component unmounted'
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
27
|
};
|
|
36
28
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
37
29
|
// Disable Exhaustive Deps here since we only want to stop the measure on mount.
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { EditorExperience } from '@atlaskit/editor-common/ufo';
|
|
5
4
|
/**
|
|
6
5
|
*
|
|
7
6
|
* Util function to be used with the Editor component to send duration analytics
|
|
8
7
|
*
|
|
9
8
|
* @param action
|
|
10
9
|
* @param props
|
|
11
|
-
* @param getExperienceStore return the ExperienceStore of the Editor
|
|
12
10
|
* @param getCreateAnalyticsEvent return the CreateUIAnalyticsEvent of the Editor
|
|
13
11
|
* @returns
|
|
14
12
|
*/
|
|
15
|
-
export default function sendDurationAnalytics(action, props,
|
|
13
|
+
export default function sendDurationAnalytics(action, props, createAnalyticsEvent) {
|
|
16
14
|
return /*#__PURE__*/function () {
|
|
17
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(duration, startTime) {
|
|
18
|
-
var
|
|
19
|
-
var contextIdentifier, objectId, experienceStore;
|
|
16
|
+
var contextIdentifier, objectId;
|
|
20
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
18
|
while (1) switch (_context.prev = _context.next) {
|
|
22
19
|
case 0:
|
|
@@ -39,14 +36,7 @@ export default function sendDurationAnalytics(action, props, getExperienceStore,
|
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
|
-
|
|
43
|
-
experienceStore = getExperienceStore();
|
|
44
|
-
experienceStore === null || experienceStore === void 0 || experienceStore.mark(EditorExperience.loadEditor, action, startTime + duration);
|
|
45
|
-
experienceStore === null || experienceStore === void 0 || experienceStore.addMetadata(EditorExperience.loadEditor, {
|
|
46
|
-
objectId: objectId
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
case 6:
|
|
39
|
+
case 5:
|
|
50
40
|
case "end":
|
|
51
41
|
return _context.stop();
|
|
52
42
|
}
|
|
@@ -7,8 +7,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
10
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
13
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
12
|
import React from 'react';
|
|
@@ -17,7 +15,6 @@ import { ACTION, ACTION_SUBJECT, editorAnalyticsChannel, EVENT_TYPE } from '@atl
|
|
|
17
15
|
import { getDocStructure } from '@atlaskit/editor-common/core-utils';
|
|
18
16
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/intl-error-boundary';
|
|
19
17
|
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
20
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
21
18
|
import { isOutdatedBrowser } from '../utils/outdatedBrowsers';
|
|
22
19
|
import { WithEditorView } from './WithEditorView';
|
|
23
20
|
export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
@@ -34,7 +31,7 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
34
31
|
_defineProperty(_assertThisInitialized(_this), "sendErrorData", /*#__PURE__*/function () {
|
|
35
32
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(analyticsErrorPayload) {
|
|
36
33
|
var _window;
|
|
37
|
-
var product, error, errorInfo,
|
|
34
|
+
var product, error, errorInfo, sharedId, browserInfo, attributes;
|
|
38
35
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
39
36
|
while (1) switch (_context.prev = _context.next) {
|
|
40
37
|
case 0:
|
|
@@ -42,7 +39,7 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
42
39
|
return _this.getProductName();
|
|
43
40
|
case 2:
|
|
44
41
|
product = _context.sent;
|
|
45
|
-
error = analyticsErrorPayload.error, errorInfo = analyticsErrorPayload.errorInfo
|
|
42
|
+
error = analyticsErrorPayload.error, errorInfo = analyticsErrorPayload.errorInfo;
|
|
46
43
|
sharedId = uuid();
|
|
47
44
|
browserInfo = ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) || 'unknown';
|
|
48
45
|
attributes = {
|
|
@@ -71,16 +68,11 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
71
68
|
errorId: sharedId
|
|
72
69
|
}
|
|
73
70
|
});
|
|
74
|
-
if (_this.featureFlags.ufo && _this.props.editorView) {
|
|
75
|
-
(_this$experienceStore = _this.experienceStore) === null || _this$experienceStore === void 0 || _this$experienceStore.failAll(_objectSpread(_objectSpread({}, _this.getExperienceMetadata(attributes)), {}, {
|
|
76
|
-
errorStack: errorStack
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
71
|
logException(error, {
|
|
80
72
|
location: 'editor-core/create-editor',
|
|
81
73
|
product: product
|
|
82
74
|
});
|
|
83
|
-
case
|
|
75
|
+
case 10:
|
|
84
76
|
case "end":
|
|
85
77
|
return _context.stop();
|
|
86
78
|
}
|
|
@@ -121,23 +113,7 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
121
113
|
var _this$props$createAna, _this$props;
|
|
122
114
|
(_this$props$createAna = (_this$props = _this.props).createAnalyticsEvent) === null || _this$props$createAna === void 0 || _this$props$createAna.call(_this$props, event).fire(editorAnalyticsChannel);
|
|
123
115
|
});
|
|
124
|
-
_defineProperty(_assertThisInitialized(_this), "getExperienceMetadata", function (attributes) {
|
|
125
|
-
var _attributes$browserEx;
|
|
126
|
-
return {
|
|
127
|
-
browserInfo: attributes.browserInfo,
|
|
128
|
-
error: attributes.error.toString(),
|
|
129
|
-
errorInfo: {
|
|
130
|
-
componentStack: attributes.errorInfo.componentStack || undefined
|
|
131
|
-
},
|
|
132
|
-
errorId: attributes.errorId,
|
|
133
|
-
browserExtensions: (_attributes$browserEx = attributes.browserExtensions) === null || _attributes$browserEx === void 0 ? void 0 : _attributes$browserEx.toString(),
|
|
134
|
-
docStructure: attributes.docStructure
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
116
|
_this.featureFlags = props.featureFlags;
|
|
138
|
-
if (props.editorView) {
|
|
139
|
-
_this.experienceStore = ExperienceStore.getInstance(props.editorView);
|
|
140
|
-
}
|
|
141
117
|
return _this;
|
|
142
118
|
}
|
|
143
119
|
_createClass(ErrorBoundaryWithEditorView, [{
|
|
@@ -22,7 +22,6 @@ import { measureRender } from '@atlaskit/editor-common/performance/measure-rende
|
|
|
22
22
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
23
23
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
24
24
|
import { processRawValue, processRawValueWithoutTransformation } from '@atlaskit/editor-common/process-raw-value';
|
|
25
|
-
import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
|
|
26
25
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
27
26
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
28
27
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -35,7 +34,7 @@ import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
|
35
34
|
import measurements from '../utils/performance/measure-enum';
|
|
36
35
|
import { PluginPerformanceObserver } from '../utils/performance/plugin-performance-observer';
|
|
37
36
|
import { freezeUnsafeTransactionProperties } from '../utils/performance/safer-transactions';
|
|
38
|
-
import {
|
|
37
|
+
import { EVENT_NAME_ON_CHANGE } from '../utils/performance/track-transactions';
|
|
39
38
|
import { validateNodes, validNode } from '../utils/validateNodes';
|
|
40
39
|
import { PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD } from './consts';
|
|
41
40
|
import { createErrorReporter, createPMPlugins, processPluginsList } from './create-editor';
|
|
@@ -261,7 +260,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
261
260
|
if (!_this.view) {
|
|
262
261
|
return;
|
|
263
262
|
}
|
|
264
|
-
startMeasure(EVENT_NAME_DISPATCH_TRANSACTION);
|
|
265
263
|
var nodes = findChangedNodesFromTransaction(unsafeTransaction);
|
|
266
264
|
var changedNodesValid = validateNodes(nodes);
|
|
267
265
|
var transaction = new Proxy(unsafeTransaction, freezeUnsafeTransactionProperties({
|
|
@@ -272,38 +270,23 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
272
270
|
var oldEditorState = _this.view.state;
|
|
273
271
|
|
|
274
272
|
// go ahead and update the state now we know the transaction is good
|
|
275
|
-
startMeasure(EVENT_NAME_STATE_APPLY);
|
|
276
273
|
var _this$view$state$appl = _this.view.state.applyTransaction(transaction),
|
|
277
274
|
editorState = _this$view$state$appl.state,
|
|
278
275
|
transactions = _this$view$state$appl.transactions;
|
|
279
|
-
stopMeasure(EVENT_NAME_STATE_APPLY, function (duration, startTime) {
|
|
280
|
-
var _this$experienceStore;
|
|
281
|
-
(_this$experienceStore = _this.experienceStore) === null || _this$experienceStore === void 0 || _this$experienceStore.mark(EditorExperience.interaction, 'stateApply', startTime + duration);
|
|
282
|
-
});
|
|
283
276
|
if (editorState === oldEditorState) {
|
|
284
277
|
return;
|
|
285
278
|
}
|
|
286
|
-
startMeasure(EVENT_NAME_UPDATE_STATE);
|
|
287
279
|
_this.view.updateState(editorState);
|
|
288
|
-
stopMeasure(EVENT_NAME_UPDATE_STATE, function (duration, startTime) {
|
|
289
|
-
var _this$experienceStore2;
|
|
290
|
-
(_this$experienceStore2 = _this.experienceStore) === null || _this$experienceStore2 === void 0 || _this$experienceStore2.mark(EditorExperience.interaction, 'viewUpdateState', startTime + duration);
|
|
291
|
-
});
|
|
292
280
|
_this.pluginInjectionAPI.onEditorViewUpdated({
|
|
293
281
|
newEditorState: editorState,
|
|
294
282
|
oldEditorState: oldEditorState
|
|
295
283
|
});
|
|
296
|
-
startMeasure(EVENT_NAME_VIEW_STATE_UPDATED);
|
|
297
284
|
_this.onEditorViewStateUpdated({
|
|
298
285
|
originalTransaction: transaction,
|
|
299
286
|
transactions: transactions,
|
|
300
287
|
oldEditorState: oldEditorState,
|
|
301
288
|
newEditorState: editorState
|
|
302
289
|
});
|
|
303
|
-
stopMeasure(EVENT_NAME_VIEW_STATE_UPDATED, function (duration, startTime) {
|
|
304
|
-
var _this$experienceStore3;
|
|
305
|
-
(_this$experienceStore3 = _this.experienceStore) === null || _this$experienceStore3 === void 0 || _this$experienceStore3.mark(EditorExperience.interaction, 'onEditorViewStateUpdated', startTime + duration);
|
|
306
|
-
});
|
|
307
290
|
if (_this.props.editorProps.onChange && transaction.docChanged) {
|
|
308
291
|
var source = transaction.getMeta('isRemote') ? 'remote' : 'local';
|
|
309
292
|
startMeasure(EVENT_NAME_ON_CHANGE);
|
|
@@ -311,8 +294,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
311
294
|
source: source
|
|
312
295
|
});
|
|
313
296
|
stopMeasure(EVENT_NAME_ON_CHANGE, function (duration, startTime) {
|
|
314
|
-
var _this$experienceStore4;
|
|
315
|
-
(_this$experienceStore4 = _this.experienceStore) === null || _this$experienceStore4 === void 0 || _this$experienceStore4.mark(EditorExperience.interaction, 'onChange', startTime + duration);
|
|
316
297
|
_this.dispatchAnalyticsEvent({
|
|
317
298
|
action: ACTION.ON_CHANGE_CALLBACK,
|
|
318
299
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -325,11 +306,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
325
306
|
});
|
|
326
307
|
}
|
|
327
308
|
_this.editorState = editorState;
|
|
328
|
-
stopMeasure(EVENT_NAME_DISPATCH_TRANSACTION, function (duration, startTime) {
|
|
329
|
-
var _this$experienceStore5, _this$experienceStore6;
|
|
330
|
-
(_this$experienceStore5 = _this.experienceStore) === null || _this$experienceStore5 === void 0 || _this$experienceStore5.mark(EditorExperience.interaction, 'dispatchTransaction', startTime + duration);
|
|
331
|
-
(_this$experienceStore6 = _this.experienceStore) === null || _this$experienceStore6 === void 0 || _this$experienceStore6.success(EditorExperience.interaction);
|
|
332
|
-
});
|
|
333
309
|
} else {
|
|
334
310
|
var invalidNodes = nodes.filter(function (node) {
|
|
335
311
|
return !validNode(node);
|
|
@@ -376,7 +352,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
376
352
|
distortedDuration = _ref3.distortedDuration;
|
|
377
353
|
_this.proseMirrorRenderedSeverity = getAnalyticsEventSeverity(duration, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD);
|
|
378
354
|
if (_this.view) {
|
|
379
|
-
var _this$pluginInjection2
|
|
355
|
+
var _this$pluginInjection2;
|
|
380
356
|
var nodes = getNodesCount(_this.view.state.doc);
|
|
381
357
|
var ttfb = getResponseEndTime();
|
|
382
358
|
var contextIdentifier = (_this$pluginInjection2 = _this.pluginInjectionAPI.api().base) === null || _this$pluginInjection2 === void 0 ? void 0 : _this$pluginInjection2.sharedState.currentState();
|
|
@@ -394,14 +370,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
394
370
|
},
|
|
395
371
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
396
372
|
});
|
|
397
|
-
if (!distortedDuration) {
|
|
398
|
-
var _this$experienceStore7;
|
|
399
|
-
(_this$experienceStore7 = _this.experienceStore) === null || _this$experienceStore7 === void 0 || _this$experienceStore7.mark(EditorExperience.loadEditor, ACTION.PROSEMIRROR_RENDERED, startTime + duration);
|
|
400
|
-
}
|
|
401
|
-
(_this$experienceStore8 = _this.experienceStore) === null || _this$experienceStore8 === void 0 || _this$experienceStore8.addMetadata(EditorExperience.loadEditor, {
|
|
402
|
-
nodes: nodes,
|
|
403
|
-
ttfb: ttfb
|
|
404
|
-
});
|
|
405
373
|
}
|
|
406
374
|
});
|
|
407
375
|
|
|
@@ -428,32 +396,6 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
428
396
|
if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
429
397
|
_this.focusTimeoutId = handleEditorFocus(view);
|
|
430
398
|
}
|
|
431
|
-
if (_this.featureFlags.ufo) {
|
|
432
|
-
_this.experienceStore = ExperienceStore.getInstance(view);
|
|
433
|
-
_this.experienceStore.start(EditorExperience.editSession);
|
|
434
|
-
_this.experienceStore.addMetadata(EditorExperience.editSession, {
|
|
435
|
-
reliabilityInterval: RELIABILITY_INTERVAL
|
|
436
|
-
});
|
|
437
|
-
_this.reliabilityInterval = window.setInterval(function () {
|
|
438
|
-
var _this$experienceStore9;
|
|
439
|
-
(_this$experienceStore9 = _this.experienceStore) === null || _this$experienceStore9 === void 0 || (_this$experienceStore9 = _this$experienceStore9.success(EditorExperience.editSession)) === null || _this$experienceStore9 === void 0 || _this$experienceStore9.finally(function () {
|
|
440
|
-
var _this$experienceStore10, _this$experienceStore11;
|
|
441
|
-
(_this$experienceStore10 = _this.experienceStore) === null || _this$experienceStore10 === void 0 || _this$experienceStore10.start(EditorExperience.editSession);
|
|
442
|
-
(_this$experienceStore11 = _this.experienceStore) === null || _this$experienceStore11 === void 0 || _this$experienceStore11.addMetadata(EditorExperience.editSession, {
|
|
443
|
-
reliabilityInterval: RELIABILITY_INTERVAL
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
var reliabilityEvent = {
|
|
447
|
-
action: ACTION.UFO_SESSION_COMPLETE,
|
|
448
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
449
|
-
attributes: {
|
|
450
|
-
interval: RELIABILITY_INTERVAL
|
|
451
|
-
},
|
|
452
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
453
|
-
};
|
|
454
|
-
_this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
455
|
-
}, RELIABILITY_INTERVAL);
|
|
456
|
-
}
|
|
457
399
|
|
|
458
400
|
// Force React to re-render so consumers get a reference to the editor view
|
|
459
401
|
_this.forceUpdate();
|
|
@@ -37,8 +37,7 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
37
37
|
},
|
|
38
38
|
base: {
|
|
39
39
|
allowInlineCursorTarget: true,
|
|
40
|
-
allowScrollGutter: getScrollGutterOptions(props)
|
|
41
|
-
ufo: createFeatureFlagsFromProps(props).ufo
|
|
40
|
+
allowScrollGutter: getScrollGutterOptions(props)
|
|
42
41
|
},
|
|
43
42
|
blockType: {
|
|
44
43
|
lastNodeMustBeParagraph: appearance === 'comment' || appearance === 'chromeless',
|
|
@@ -25,7 +25,7 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$
|
|
28
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$collabEdit, _props$collabEdit2;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
31
31
|
catchAllTracking: false,
|
|
@@ -34,8 +34,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
34
34
|
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags5 = props.featureFlags) === null || _props$featureFlags5 === void 0 ? void 0 : _props$featureFlags5.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.synchronyErrorDocStructure) : false),
|
|
35
35
|
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.enableViewUpdateSubscription) : false),
|
|
36
36
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.collabAvatarScroll) : false),
|
|
37
|
-
|
|
38
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
37
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.twoLineEditorToolbar) : false),
|
|
39
38
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
40
39
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
|
|
41
40
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "
|
|
2
|
+
export var version = "199.0.0";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
|
-
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
3
2
|
import type { EditorNextProps, EditorProps } from '../../types/editor-props';
|
|
4
3
|
/**
|
|
5
4
|
*
|
|
@@ -7,7 +6,6 @@ import type { EditorNextProps, EditorProps } from '../../types/editor-props';
|
|
|
7
6
|
* WARNING: Consider any changes to also make to `src/editor.tsx`
|
|
8
7
|
*
|
|
9
8
|
* @param props EditorProps
|
|
10
|
-
* @param getExperienceStore function to retrieve the Editor's current ExperienceStore
|
|
11
9
|
* @param createAnalyticsEvent
|
|
12
10
|
*/
|
|
13
|
-
export default function useMeasureEditorMountTime(props: EditorProps | EditorNextProps,
|
|
11
|
+
export default function useMeasureEditorMountTime(props: EditorProps | EditorNextProps, createAnalyticsEvent: CreateUIAnalyticsEvent): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
2
2
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
4
3
|
import type { EditorProps } from '../../types/editor-props';
|
|
5
4
|
/**
|
|
6
5
|
*
|
|
@@ -8,8 +7,7 @@ import type { EditorProps } from '../../types/editor-props';
|
|
|
8
7
|
*
|
|
9
8
|
* @param action
|
|
10
9
|
* @param props
|
|
11
|
-
* @param getExperienceStore return the ExperienceStore of the Editor
|
|
12
10
|
* @param getCreateAnalyticsEvent return the CreateUIAnalyticsEvent of the Editor
|
|
13
11
|
* @returns
|
|
14
12
|
*/
|
|
15
|
-
export default function sendDurationAnalytics(action: ACTION.EDITOR_MOUNTED | ACTION.ON_EDITOR_READY_CALLBACK, props: Pick<EditorProps, 'contextIdentifierProvider' | 'featureFlags'>,
|
|
13
|
+
export default function sendDurationAnalytics(action: ACTION.EDITOR_MOUNTED | ACTION.ON_EDITOR_READY_CALLBACK, props: Pick<EditorProps, 'contextIdentifierProvider' | 'featureFlags'>, createAnalyticsEvent: CreateUIAnalyticsEvent | undefined): (duration: number, startTime: number) => Promise<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { type ErrorInfo } from 'react';
|
|
2
2
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
5
4
|
import type { UserBrowserExtensionResults } from '@atlaskit/editor-common/utils';
|
|
6
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
6
|
import type { FeatureFlags } from '../types/feature-flags';
|
|
@@ -20,7 +19,6 @@ export type ErrorBoundaryState = {
|
|
|
20
19
|
export declare class ErrorBoundaryWithEditorView extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
21
20
|
featureFlags: FeatureFlags;
|
|
22
21
|
browserExtensions?: UserBrowserExtensionResults;
|
|
23
|
-
experienceStore?: ExperienceStore;
|
|
24
22
|
static defaultProps: {
|
|
25
23
|
rethrow: boolean;
|
|
26
24
|
errorTracking: boolean;
|
|
@@ -32,7 +30,6 @@ export declare class ErrorBoundaryWithEditorView extends React.Component<ErrorBo
|
|
|
32
30
|
private sendErrorData;
|
|
33
31
|
private getProductName;
|
|
34
32
|
private fireAnalyticsEvent;
|
|
35
|
-
private getExperienceMetadata;
|
|
36
33
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
37
34
|
render(): JSX.Element;
|
|
38
35
|
}
|