@atlaskit/editor-core 222.1.2 → 223.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 +20 -0
- package/dist/cjs/composable-editor/core-editor.js +0 -4
- package/dist/cjs/composable-editor/editor-internal.js +1 -20
- package/dist/cjs/create-editor/ReactEditorView.js +1 -12
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +1 -5
- package/dist/es2019/composable-editor/editor-internal.js +1 -20
- package/dist/es2019/create-editor/ReactEditorView.js +1 -12
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +1 -5
- package/dist/esm/composable-editor/editor-internal.js +1 -20
- package/dist/esm/create-editor/ReactEditorView.js +1 -12
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor-internal.d.ts +0 -2
- package/package.json +19 -22
- package/dist/cjs/utils/performance/components/RenderTracking.js +0 -44
- package/dist/es2019/utils/performance/components/RenderTracking.js +0 -36
- package/dist/esm/utils/performance/components/RenderTracking.js +0 -37
- package/dist/types/utils/performance/components/RenderTracking.d.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 223.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b31485c214f8d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b31485c214f8d) -
|
|
8
|
+
Clean up feature gate `platform_editor_disable_rerender_tracking_jira`.
|
|
9
|
+
|
|
10
|
+
The `lcmPreventRenderTracking` field has been removed from the public `FeatureFlags` type. Remove
|
|
11
|
+
the field from any feature flag configuration because render tracking is no longer conditional:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
// Before
|
|
15
|
+
const featureFlags: FeatureFlags = { lcmPreventRenderTracking: true };
|
|
16
|
+
|
|
17
|
+
// After
|
|
18
|
+
const featureFlags: FeatureFlags = {};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 222.1.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -54,9 +54,6 @@ function Editor(passedProps) {
|
|
|
54
54
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
55
55
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
56
56
|
var editorViewRef = (0, _react.useRef)(null);
|
|
57
|
-
var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
|
|
58
|
-
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)(data);
|
|
59
|
-
}, [createAnalyticsEvent]);
|
|
60
57
|
var getFeatureFlagsFromRef = (0, _react.useCallback)(function () {
|
|
61
58
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
62
59
|
return _objectSpread(_objectSpread({}, (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(propsRef.current.featureFlags)), {}, {
|
|
@@ -100,7 +97,6 @@ function Editor(passedProps) {
|
|
|
100
97
|
editorViewRef: editorViewRef
|
|
101
98
|
}) : null, /*#__PURE__*/_react.default.createElement(_editorInternal.EditorInternal, {
|
|
102
99
|
props: props,
|
|
103
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
104
100
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
105
101
|
preset: props.preset,
|
|
106
102
|
handleSave: handleSave,
|
|
@@ -9,10 +9,8 @@ exports.EditorInternal = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
12
|
var _portal = require("@atlaskit/editor-common/portal");
|
|
14
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
14
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
17
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
16
|
var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBoundary"));
|
|
@@ -20,7 +18,6 @@ var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEdi
|
|
|
20
18
|
var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
|
|
21
19
|
var _IntlProviderIfMissingWrapper = require("../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper");
|
|
22
20
|
var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
|
|
23
|
-
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
24
21
|
var _BaseThemeWrapper = require("./BaseThemeWrapper");
|
|
25
22
|
var _editorInternalCompiled = require("./editor-internal-compiled");
|
|
26
23
|
var _editorInternalEmotion = require("./editor-internal-emotion");
|
|
@@ -31,15 +28,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
31
28
|
var EditorInternalContainerMigration = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
32
29
|
return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
|
|
33
30
|
}, _editorInternalCompiled.EditorInternalContainerCompiled, _editorInternalEmotion.EditorInternalContainerEmotion);
|
|
34
|
-
var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
35
|
-
|
|
36
31
|
/**
|
|
37
32
|
* EditorInternalComponent is used to capture the common component
|
|
38
33
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
39
34
|
*/
|
|
40
35
|
var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
41
36
|
var props = _ref.props,
|
|
42
|
-
handleAnalyticsEvent = _ref.handleAnalyticsEvent,
|
|
43
37
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
44
38
|
handleSave = _ref.handleSave,
|
|
45
39
|
editorActions = _ref.editorActions,
|
|
@@ -54,11 +48,6 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
54
48
|
analyticsHandler: undefined
|
|
55
49
|
});
|
|
56
50
|
var featureFlags = (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props.featureFlags);
|
|
57
|
-
|
|
58
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
59
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
60
|
-
var renderTrackingEnabled = !(0, _platformFeatureFlags.fg)('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
61
|
-
var useShallow = false;
|
|
62
51
|
var _usePortalProvider = (0, _portal.usePortalProvider)(),
|
|
63
52
|
_usePortalProvider2 = (0, _slicedToArray2.default)(_usePortalProvider, 2),
|
|
64
53
|
portalProviderAPI = _usePortalProvider2[0],
|
|
@@ -67,21 +56,13 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
67
56
|
_usePortalProvider4 = (0, _slicedToArray2.default)(_usePortalProvider3, 2),
|
|
68
57
|
nodeViewPortalProviderAPI = _usePortalProvider4[0],
|
|
69
58
|
NodeViewPortalRenderer = _usePortalProvider4[1];
|
|
70
|
-
var propsToIgnore = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
71
59
|
var baseFontSize = (0, _getBaseFontSize.getBaseFontSize)(props.appearance, props.contentMode);
|
|
72
60
|
var fontSize = (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true) || (0, _expValEquals.expValEquals)('platform_editor_core_static_css', 'isEnabled', true) ? (0, _editorSharedStyles.editorFontSize)({
|
|
73
61
|
theme: {
|
|
74
62
|
baseFontSize: baseFontSize
|
|
75
63
|
}
|
|
76
64
|
}) : undefined;
|
|
77
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null,
|
|
78
|
-
componentProps: props,
|
|
79
|
-
action: _analytics.ACTION.RE_RENDERED,
|
|
80
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
81
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
82
|
-
propsToIgnore: propsToIgnore,
|
|
83
|
-
useShallow: useShallow
|
|
84
|
-
}), /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, {
|
|
85
66
|
errorTracking: true,
|
|
86
67
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
87
68
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
@@ -47,7 +47,6 @@ var _getNodesCountWithExtensionKeys = require("../utils/getNodesCountWithExtensi
|
|
|
47
47
|
var _getNodesVisibleInViewport = require("../utils/getNodesVisibleInViewport");
|
|
48
48
|
var _isChromeless = require("../utils/is-chromeless");
|
|
49
49
|
var _isFullPage = require("../utils/is-full-page");
|
|
50
|
-
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
51
50
|
var _measureEnum = _interopRequireDefault(require("../utils/performance/measure-enum"));
|
|
52
51
|
var _consts = require("./consts");
|
|
53
52
|
var _createEditor = require("./create-editor");
|
|
@@ -1191,23 +1190,13 @@ function ReactEditorView(props) {
|
|
|
1191
1190
|
// We should follow-up
|
|
1192
1191
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1193
1192
|
[props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy, ssrEditor]);
|
|
1194
|
-
|
|
1195
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
1196
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
1197
|
-
var renderTrackingEnabled = !(0, _platformFeatureFlags.fg)('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
1198
1193
|
return /*#__PURE__*/_react.default.createElement(_ssrMeasures.SSRRenderMeasure, {
|
|
1199
1194
|
segmentName: SSR_TRACE_SEGMENT_NAME,
|
|
1200
1195
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
1201
1196
|
onSSRMeasure: onSSRMeasure
|
|
1202
1197
|
}, /*#__PURE__*/_react.default.createElement(_uiReact.ReactEditorViewContext.Provider, {
|
|
1203
1198
|
value: reactEditorViewContext
|
|
1204
|
-
},
|
|
1205
|
-
componentProps: props,
|
|
1206
|
-
action: _analytics.ACTION.RE_RENDERED,
|
|
1207
|
-
actionSubject: _analytics.ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
1208
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
1209
|
-
useShallow: true
|
|
1210
|
-
}), props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1199
|
+
}, props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1211
1200
|
editor: editor,
|
|
1212
1201
|
view: viewRef.current,
|
|
1213
1202
|
config: config.current,
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
8
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
9
|
-
var version = exports.version = "222.1.
|
|
9
|
+
var version = exports.version = "222.1.2";
|
|
@@ -5,7 +5,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
5
5
|
import uuid from 'uuid/v4';
|
|
6
6
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
7
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
8
|
-
import { ACTION
|
|
8
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
10
10
|
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -41,9 +41,6 @@ function Editor(passedProps) {
|
|
|
41
41
|
createAnalyticsEvent
|
|
42
42
|
} = useAnalyticsEvents();
|
|
43
43
|
const editorViewRef = useRef(null);
|
|
44
|
-
const handleAnalyticsEvent = useCallback(data => {
|
|
45
|
-
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
46
|
-
}, [createAnalyticsEvent]);
|
|
47
44
|
const getFeatureFlagsFromRef = useCallback(() => {
|
|
48
45
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
49
46
|
return {
|
|
@@ -93,7 +90,6 @@ function Editor(passedProps) {
|
|
|
93
90
|
editorViewRef: editorViewRef
|
|
94
91
|
}) : null, /*#__PURE__*/React.createElement(EditorInternal, {
|
|
95
92
|
props: props,
|
|
96
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
97
93
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
98
94
|
preset: props.preset,
|
|
99
95
|
handleSave: handleSave,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { Fragment, memo } from 'react';
|
|
2
|
-
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
4
3
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
4
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
7
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
6
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
@@ -10,21 +8,17 @@ import ReactEditorViewNext from '../create-editor/ReactEditorView';
|
|
|
10
8
|
import EditorContext from '../ui/EditorContext';
|
|
11
9
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
12
10
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
13
|
-
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
14
11
|
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
15
12
|
import { EditorInternalContainerCompiled } from './editor-internal-compiled';
|
|
16
13
|
import { EditorInternalContainerEmotion } from './editor-internal-emotion';
|
|
17
14
|
import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
18
15
|
const EditorInternalContainerMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), EditorInternalContainerCompiled, EditorInternalContainerEmotion);
|
|
19
|
-
const DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
20
|
-
|
|
21
16
|
/**
|
|
22
17
|
* EditorInternalComponent is used to capture the common component
|
|
23
18
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
24
19
|
*/
|
|
25
20
|
export const EditorInternal = /*#__PURE__*/memo(({
|
|
26
21
|
props,
|
|
27
|
-
handleAnalyticsEvent,
|
|
28
22
|
createAnalyticsEvent,
|
|
29
23
|
handleSave,
|
|
30
24
|
editorActions,
|
|
@@ -41,28 +35,15 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
41
35
|
analyticsHandler: undefined
|
|
42
36
|
};
|
|
43
37
|
const featureFlags = createFeatureFlagsFromProps(props.featureFlags);
|
|
44
|
-
|
|
45
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
46
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
47
|
-
const renderTrackingEnabled = !fg('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
48
|
-
const useShallow = false;
|
|
49
38
|
const [portalProviderAPI, PortalRenderer] = usePortalProvider();
|
|
50
39
|
const [nodeViewPortalProviderAPI, NodeViewPortalRenderer] = usePortalProvider();
|
|
51
|
-
const propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
52
40
|
const baseFontSize = getBaseFontSize(props.appearance, props.contentMode);
|
|
53
41
|
const fontSize = expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true) || expValEquals('platform_editor_core_static_css', 'isEnabled', true) ? editorFontSize({
|
|
54
42
|
theme: {
|
|
55
43
|
baseFontSize
|
|
56
44
|
}
|
|
57
45
|
}) : undefined;
|
|
58
|
-
return /*#__PURE__*/React.createElement(Fragment, null,
|
|
59
|
-
componentProps: props,
|
|
60
|
-
action: ACTION.RE_RENDERED,
|
|
61
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
62
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
63
|
-
propsToIgnore: propsToIgnore,
|
|
64
|
-
useShallow: useShallow
|
|
65
|
-
}), /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
46
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
66
47
|
errorTracking: true,
|
|
67
48
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
68
49
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
@@ -36,7 +36,6 @@ import { getNodesCountWithExtensionKeys } from '../utils/getNodesCountWithExtens
|
|
|
36
36
|
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
37
37
|
import { isChromeless } from '../utils/is-chromeless';
|
|
38
38
|
import { isFullPage } from '../utils/is-full-page';
|
|
39
|
-
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
40
39
|
import measurements from '../utils/performance/measure-enum';
|
|
41
40
|
import { PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD } from './consts';
|
|
42
41
|
import { processPluginsList } from './create-editor';
|
|
@@ -1107,23 +1106,13 @@ export function ReactEditorView(props) {
|
|
|
1107
1106
|
// We should follow-up
|
|
1108
1107
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1109
1108
|
[props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy, ssrEditor]);
|
|
1110
|
-
|
|
1111
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
1112
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
1113
|
-
const renderTrackingEnabled = !fg('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
1114
1109
|
return /*#__PURE__*/React.createElement(SSRRenderMeasure, {
|
|
1115
1110
|
segmentName: SSR_TRACE_SEGMENT_NAME,
|
|
1116
1111
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
1117
1112
|
onSSRMeasure: onSSRMeasure
|
|
1118
1113
|
}, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
1119
1114
|
value: reactEditorViewContext
|
|
1120
|
-
},
|
|
1121
|
-
componentProps: props,
|
|
1122
|
-
action: ACTION.RE_RENDERED,
|
|
1123
|
-
actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
1124
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
1125
|
-
useShallow: true
|
|
1126
|
-
}), props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1115
|
+
}, props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1127
1116
|
editor,
|
|
1128
1117
|
view: viewRef.current,
|
|
1129
1118
|
config: config.current,
|
|
@@ -9,7 +9,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
9
9
|
import uuid from 'uuid/v4';
|
|
10
10
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
12
|
-
import { ACTION
|
|
12
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
14
14
|
import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
|
|
15
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -46,9 +46,6 @@ function Editor(passedProps) {
|
|
|
46
46
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
47
47
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
48
48
|
var editorViewRef = useRef(null);
|
|
49
|
-
var handleAnalyticsEvent = useCallback(function (data) {
|
|
50
|
-
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
51
|
-
}, [createAnalyticsEvent]);
|
|
52
49
|
var getFeatureFlagsFromRef = useCallback(function () {
|
|
53
50
|
var _propsRef$current$col, _propsRef$current$col2;
|
|
54
51
|
return _objectSpread(_objectSpread({}, createFeatureFlagsFromProps(propsRef.current.featureFlags)), {}, {
|
|
@@ -92,7 +89,6 @@ function Editor(passedProps) {
|
|
|
92
89
|
editorViewRef: editorViewRef
|
|
93
90
|
}) : null, /*#__PURE__*/React.createElement(EditorInternal, {
|
|
94
91
|
props: props,
|
|
95
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
96
92
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
97
93
|
preset: props.preset,
|
|
98
94
|
handleSave: handleSave,
|
|
@@ -3,10 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
import React, { Fragment, memo } from 'react';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
7
6
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
8
7
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
8
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
11
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
10
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
@@ -14,7 +12,6 @@ import ReactEditorViewNext from '../create-editor/ReactEditorView';
|
|
|
14
12
|
import EditorContext from '../ui/EditorContext';
|
|
15
13
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
16
14
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
17
|
-
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
18
15
|
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
19
16
|
import { EditorInternalContainerCompiled } from './editor-internal-compiled';
|
|
20
17
|
import { EditorInternalContainerEmotion } from './editor-internal-emotion';
|
|
@@ -22,15 +19,12 @@ import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
|
22
19
|
var EditorInternalContainerMigration = componentWithCondition(function () {
|
|
23
20
|
return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
|
|
24
21
|
}, EditorInternalContainerCompiled, EditorInternalContainerEmotion);
|
|
25
|
-
var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
26
|
-
|
|
27
22
|
/**
|
|
28
23
|
* EditorInternalComponent is used to capture the common component
|
|
29
24
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
30
25
|
*/
|
|
31
26
|
export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
32
27
|
var props = _ref.props,
|
|
33
|
-
handleAnalyticsEvent = _ref.handleAnalyticsEvent,
|
|
34
28
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
35
29
|
handleSave = _ref.handleSave,
|
|
36
30
|
editorActions = _ref.editorActions,
|
|
@@ -45,11 +39,6 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
39
|
analyticsHandler: undefined
|
|
46
40
|
});
|
|
47
41
|
var featureFlags = createFeatureFlagsFromProps(props.featureFlags);
|
|
48
|
-
|
|
49
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
50
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
51
|
-
var renderTrackingEnabled = !fg('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
52
|
-
var useShallow = false;
|
|
53
42
|
var _usePortalProvider = usePortalProvider(),
|
|
54
43
|
_usePortalProvider2 = _slicedToArray(_usePortalProvider, 2),
|
|
55
44
|
portalProviderAPI = _usePortalProvider2[0],
|
|
@@ -58,21 +47,13 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
58
47
|
_usePortalProvider4 = _slicedToArray(_usePortalProvider3, 2),
|
|
59
48
|
nodeViewPortalProviderAPI = _usePortalProvider4[0],
|
|
60
49
|
NodeViewPortalRenderer = _usePortalProvider4[1];
|
|
61
|
-
var propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
62
50
|
var baseFontSize = getBaseFontSize(props.appearance, props.contentMode);
|
|
63
51
|
var fontSize = expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true) || expValEquals('platform_editor_core_static_css', 'isEnabled', true) ? editorFontSize({
|
|
64
52
|
theme: {
|
|
65
53
|
baseFontSize: baseFontSize
|
|
66
54
|
}
|
|
67
55
|
}) : undefined;
|
|
68
|
-
return /*#__PURE__*/React.createElement(Fragment, null,
|
|
69
|
-
componentProps: props,
|
|
70
|
-
action: ACTION.RE_RENDERED,
|
|
71
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
72
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
73
|
-
propsToIgnore: propsToIgnore,
|
|
74
|
-
useShallow: useShallow
|
|
75
|
-
}), /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
56
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
76
57
|
errorTracking: true,
|
|
77
58
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
78
59
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
@@ -44,7 +44,6 @@ import { getNodesCountWithExtensionKeys } from '../utils/getNodesCountWithExtens
|
|
|
44
44
|
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
45
45
|
import { isChromeless } from '../utils/is-chromeless';
|
|
46
46
|
import { isFullPage } from '../utils/is-full-page';
|
|
47
|
-
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
48
47
|
import measurements from '../utils/performance/measure-enum';
|
|
49
48
|
import { PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD } from './consts';
|
|
50
49
|
import { processPluginsList } from './create-editor';
|
|
@@ -1182,23 +1181,13 @@ export function ReactEditorView(props) {
|
|
|
1182
1181
|
// We should follow-up
|
|
1183
1182
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1184
1183
|
[props.editorProps.assistiveLabel, props.editorProps.assistiveDescribedBy, ssrEditor]);
|
|
1185
|
-
|
|
1186
|
-
// Render tracking is firing too many events in Jira so we are disabling them for now. See - https://product-fabric.atlassian.net/browse/ED-25616
|
|
1187
|
-
// Also firing too many events for the legacy content macro, so disabling for now. See - https://product-fabric.atlassian.net/browse/ED-26650
|
|
1188
|
-
var renderTrackingEnabled = !fg('platform_editor_disable_rerender_tracking_jira') && !featureFlags.lcmPreventRenderTracking;
|
|
1189
1184
|
return /*#__PURE__*/React.createElement(SSRRenderMeasure, {
|
|
1190
1185
|
segmentName: SSR_TRACE_SEGMENT_NAME,
|
|
1191
1186
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
1192
1187
|
onSSRMeasure: onSSRMeasure
|
|
1193
1188
|
}, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
1194
1189
|
value: reactEditorViewContext
|
|
1195
|
-
},
|
|
1196
|
-
componentProps: props,
|
|
1197
|
-
action: ACTION.RE_RENDERED,
|
|
1198
|
-
actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
1199
|
-
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
1200
|
-
useShallow: true
|
|
1201
|
-
}), props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1190
|
+
}, props.render ? (_props$render = (_props$render2 = props.render) === null || _props$render2 === void 0 ? void 0 : _props$render2.call(props, {
|
|
1202
1191
|
editor: editor,
|
|
1203
1192
|
view: viewRef.current,
|
|
1204
1193
|
config: config.current,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MemoExoticComponent } from 'react';
|
|
3
3
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
4
|
-
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
5
|
import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
7
6
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -14,7 +13,6 @@ interface InternalProps {
|
|
|
14
13
|
AppearanceComponent: React.ComponentType<React.PropsWithChildren<EditorAppearanceComponentProps<[]>>>;
|
|
15
14
|
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
16
15
|
editorActions: EditorActions;
|
|
17
|
-
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
18
16
|
handleSave: (view: EditorView) => void;
|
|
19
17
|
onEditorCreated: (instance: {
|
|
20
18
|
eventDispatcher: EventDispatcher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "223.0.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,21 +47,21 @@
|
|
|
47
47
|
"@atlaskit/css": "^1.0.0",
|
|
48
48
|
"@atlaskit/editor-json-transformer": "^9.2.0",
|
|
49
49
|
"@atlaskit/editor-performance-metrics": "^3.2.0",
|
|
50
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
51
|
-
"@atlaskit/editor-plugin-quick-insert": "^
|
|
52
|
-
"@atlaskit/editor-plugin-user-preferences": "^
|
|
50
|
+
"@atlaskit/editor-plugin-connectivity": "^14.0.0",
|
|
51
|
+
"@atlaskit/editor-plugin-quick-insert": "^14.0.0",
|
|
52
|
+
"@atlaskit/editor-plugin-user-preferences": "^12.0.0",
|
|
53
53
|
"@atlaskit/editor-plugins": "^15.0.0",
|
|
54
54
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
55
55
|
"@atlaskit/editor-shared-styles": "^4.0.0",
|
|
56
|
-
"@atlaskit/editor-ssr-renderer": "^
|
|
56
|
+
"@atlaskit/editor-ssr-renderer": "^9.0.0",
|
|
57
57
|
"@atlaskit/editor-toolbar": "^2.4.0",
|
|
58
58
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
59
59
|
"@atlaskit/emoji": "^71.15.0",
|
|
60
60
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
61
61
|
"@atlaskit/icon": "^37.3.0",
|
|
62
62
|
"@atlaskit/link": "^5.0.0",
|
|
63
|
-
"@atlaskit/media-card": "^81.
|
|
64
|
-
"@atlaskit/mention": "^27.
|
|
63
|
+
"@atlaskit/media-card": "^81.6.0",
|
|
64
|
+
"@atlaskit/mention": "^27.13.0",
|
|
65
65
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
67
67
|
"@atlaskit/platform-feature-flags-react": "^1.1.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"uuid": "^3.1.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@atlaskit/editor-common": "^
|
|
89
|
+
"@atlaskit/editor-common": "^118.0.0",
|
|
90
90
|
"@atlaskit/link-provider": "^5.3.0",
|
|
91
91
|
"@atlaskit/media-core": "^38.0.0",
|
|
92
92
|
"react": "^18.2.0",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"@atlaskit/adf-utils": "^20.5.0",
|
|
101
101
|
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
102
102
|
"@atlaskit/code": "^18.2.0",
|
|
103
|
-
"@atlaskit/collab-provider": "^
|
|
104
|
-
"@atlaskit/editor-plugin-annotation": "^
|
|
105
|
-
"@atlaskit/editor-plugin-card": "^
|
|
106
|
-
"@atlaskit/editor-plugin-list": "^
|
|
107
|
-
"@atlaskit/editor-plugin-paste": "^
|
|
103
|
+
"@atlaskit/collab-provider": "^23.0.0",
|
|
104
|
+
"@atlaskit/editor-plugin-annotation": "^14.0.0",
|
|
105
|
+
"@atlaskit/editor-plugin-card": "^20.0.0",
|
|
106
|
+
"@atlaskit/editor-plugin-list": "^16.0.0",
|
|
107
|
+
"@atlaskit/editor-plugin-paste": "^15.0.0",
|
|
108
108
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
109
109
|
"@atlaskit/link-provider": "^5.3.0",
|
|
110
110
|
"@atlaskit/linking-common": "^11.0.0",
|
|
@@ -113,21 +113,21 @@
|
|
|
113
113
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
114
114
|
"@atlaskit/media-test-helpers": "^42.2.0",
|
|
115
115
|
"@atlaskit/modal-dialog": "^16.3.0",
|
|
116
|
-
"@atlaskit/popper": "^9.
|
|
116
|
+
"@atlaskit/popper": "^9.1.0",
|
|
117
117
|
"@atlaskit/portal": "^6.2.0",
|
|
118
|
-
"@atlaskit/renderer": "^
|
|
118
|
+
"@atlaskit/renderer": "^135.0.0",
|
|
119
119
|
"@atlaskit/section-message": "^10.0.0",
|
|
120
120
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
121
121
|
"@atlaskit/toggle": "^17.1.0",
|
|
122
122
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
123
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
123
|
+
"@atlassian/a11y-jest-testing": "^0.15.0",
|
|
124
124
|
"@atlassian/a11y-playwright-testing": "^0.10.0",
|
|
125
125
|
"@atlassian/adf-schema-json": "^1.34.0",
|
|
126
|
-
"@atlassian/editor-rovo-bridge": "^
|
|
126
|
+
"@atlassian/editor-rovo-bridge": "^12.0.0",
|
|
127
127
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
128
128
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
129
|
-
"@atlassian/search-client": "^2.
|
|
130
|
-
"@atlassian/search-provider": "^
|
|
129
|
+
"@atlassian/search-client": "^2.11.0",
|
|
130
|
+
"@atlassian/search-provider": "^15.0.0",
|
|
131
131
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
132
132
|
"@atlassian/user-profile-card": "^1.28.0",
|
|
133
133
|
"@emotion/jest": "^11.8.0",
|
|
@@ -199,9 +199,6 @@
|
|
|
199
199
|
"platform_editor_toolbar_responsive_fixes": {
|
|
200
200
|
"type": "boolean"
|
|
201
201
|
},
|
|
202
|
-
"platform_editor_disable_rerender_tracking_jira": {
|
|
203
|
-
"type": "boolean"
|
|
204
|
-
},
|
|
205
202
|
"platform-component-visual-refresh": {
|
|
206
203
|
"type": "boolean",
|
|
207
204
|
"referenceOnly": true
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.RenderTracking = RenderTracking;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
10
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
-
var _useComponentRenderTracking = require("@atlaskit/editor-common/use-component-render-tracking");
|
|
12
|
-
function RenderTracking(props) {
|
|
13
|
-
var debouncedHandleAnalyticsEvent = (0, _react.useMemo)(function () {
|
|
14
|
-
return (0, _debounce.default)(props.handleAnalyticsEvent, 500);
|
|
15
|
-
}, [props.handleAnalyticsEvent]);
|
|
16
|
-
(0, _useComponentRenderTracking.useComponentRenderTracking)({
|
|
17
|
-
onRender: function onRender(_ref) {
|
|
18
|
-
var renderCount = _ref.renderCount,
|
|
19
|
-
propsDifference = _ref.propsDifference;
|
|
20
|
-
if (!renderCount) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
debouncedHandleAnalyticsEvent({
|
|
24
|
-
payload: {
|
|
25
|
-
action: props.action,
|
|
26
|
-
actionSubject: props.actionSubject,
|
|
27
|
-
attributes: {
|
|
28
|
-
count: renderCount,
|
|
29
|
-
propsDifference: propsDifference
|
|
30
|
-
},
|
|
31
|
-
eventType: _analytics.EVENT_TYPE.OPERATIONAL
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
propsDiffingOptions: {
|
|
36
|
-
enabled: true,
|
|
37
|
-
props: props.componentProps,
|
|
38
|
-
propsToIgnore: props.propsToIgnore,
|
|
39
|
-
useShallow: props.useShallow
|
|
40
|
-
},
|
|
41
|
-
zeroBasedCount: true
|
|
42
|
-
});
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import debounce from 'lodash/debounce';
|
|
3
|
-
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
|
-
export function RenderTracking(props) {
|
|
6
|
-
const debouncedHandleAnalyticsEvent = useMemo(() => debounce(props.handleAnalyticsEvent, 500), [props.handleAnalyticsEvent]);
|
|
7
|
-
useComponentRenderTracking({
|
|
8
|
-
onRender: ({
|
|
9
|
-
renderCount,
|
|
10
|
-
propsDifference
|
|
11
|
-
}) => {
|
|
12
|
-
if (!renderCount) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
debouncedHandleAnalyticsEvent({
|
|
16
|
-
payload: {
|
|
17
|
-
action: props.action,
|
|
18
|
-
actionSubject: props.actionSubject,
|
|
19
|
-
attributes: {
|
|
20
|
-
count: renderCount,
|
|
21
|
-
propsDifference: propsDifference
|
|
22
|
-
},
|
|
23
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
propsDiffingOptions: {
|
|
28
|
-
enabled: true,
|
|
29
|
-
props: props.componentProps,
|
|
30
|
-
propsToIgnore: props.propsToIgnore,
|
|
31
|
-
useShallow: props.useShallow
|
|
32
|
-
},
|
|
33
|
-
zeroBasedCount: true
|
|
34
|
-
});
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import debounce from 'lodash/debounce';
|
|
3
|
-
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
|
-
export function RenderTracking(props) {
|
|
6
|
-
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
7
|
-
return debounce(props.handleAnalyticsEvent, 500);
|
|
8
|
-
}, [props.handleAnalyticsEvent]);
|
|
9
|
-
useComponentRenderTracking({
|
|
10
|
-
onRender: function onRender(_ref) {
|
|
11
|
-
var renderCount = _ref.renderCount,
|
|
12
|
-
propsDifference = _ref.propsDifference;
|
|
13
|
-
if (!renderCount) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
debouncedHandleAnalyticsEvent({
|
|
17
|
-
payload: {
|
|
18
|
-
action: props.action,
|
|
19
|
-
actionSubject: props.actionSubject,
|
|
20
|
-
attributes: {
|
|
21
|
-
count: renderCount,
|
|
22
|
-
propsDifference: propsDifference
|
|
23
|
-
},
|
|
24
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
propsDiffingOptions: {
|
|
29
|
-
enabled: true,
|
|
30
|
-
props: props.componentProps,
|
|
31
|
-
propsToIgnore: props.propsToIgnore,
|
|
32
|
-
useShallow: props.useShallow
|
|
33
|
-
},
|
|
34
|
-
zeroBasedCount: true
|
|
35
|
-
});
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT, FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
type RenderActions = ACTION.RE_RENDERED;
|
|
3
|
-
type RenderActionSubjects = ACTION_SUBJECT.EDITOR | ACTION_SUBJECT.REACT_EDITOR_VIEW;
|
|
4
|
-
export type RenderTrackingProps<ComponentProps> = {
|
|
5
|
-
action: RenderActions;
|
|
6
|
-
actionSubject: RenderActionSubjects;
|
|
7
|
-
componentProps: ComponentProps;
|
|
8
|
-
handleAnalyticsEvent: FireAnalyticsCallback;
|
|
9
|
-
propsToIgnore?: Array<keyof ComponentProps>;
|
|
10
|
-
useShallow?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare function RenderTracking<Props>(props: RenderTrackingProps<Props>): null;
|
|
13
|
-
export {};
|