@atlaskit/editor-core 221.8.3 → 221.9.1
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 +19 -0
- package/dist/cjs/composable-editor/core-editor.js +6 -1
- package/dist/cjs/composable-editor/editor-inp-metrics.js +17 -6
- package/dist/cjs/create-editor/ReactEditorView.js +9 -0
- package/dist/cjs/ui/ContextPanel/index-compiled.compiled.css +0 -1
- package/dist/cjs/ui/ContextPanel/index-compiled.js +46 -23
- package/dist/cjs/utils/getEditorDomSize.js +17 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/core-editor.js +6 -1
- package/dist/es2019/composable-editor/editor-inp-metrics.js +16 -4
- package/dist/es2019/create-editor/ReactEditorView.js +9 -0
- package/dist/es2019/ui/ContextPanel/index-compiled.compiled.css +0 -1
- package/dist/es2019/ui/ContextPanel/index-compiled.js +43 -20
- package/dist/es2019/utils/getEditorDomSize.js +11 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/core-editor.js +6 -1
- package/dist/esm/composable-editor/editor-inp-metrics.js +17 -6
- package/dist/esm/create-editor/ReactEditorView.js +9 -0
- package/dist/esm/ui/ContextPanel/index-compiled.compiled.css +0 -1
- package/dist/esm/ui/ContextPanel/index-compiled.js +45 -23
- package/dist/esm/utils/getEditorDomSize.js +11 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor-inp-metrics.d.ts +7 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbarNext.d.ts +0 -1
- package/dist/types/ui/ContextPanel/index-compiled.d.ts +0 -11
- package/dist/types/utils/getEditorDomSize.d.ts +10 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 221.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c9c84b6b7437c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c9c84b6b7437c) -
|
|
8
|
+
refactor context panel styles
|
|
9
|
+
|
|
10
|
+
## 221.9.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`1f968eb29f086`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f968eb29f086) -
|
|
15
|
+
Add editorDomSize (total editor DOM element count) to proseMirrorRendered, INP and UFO performance
|
|
16
|
+
events, gated behind the platform_editor_dom_node_count experiment
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 221.8.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -53,6 +53,7 @@ function Editor(passedProps) {
|
|
|
53
53
|
var editorActions = editorContext.editorActions || editorActionsPlaceholderInstance;
|
|
54
54
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
55
55
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
56
|
+
var editorViewRef = (0, _react.useRef)(null);
|
|
56
57
|
var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
|
|
57
58
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)(data);
|
|
58
59
|
}, [createAnalyticsEvent]);
|
|
@@ -67,6 +68,7 @@ function Editor(passedProps) {
|
|
|
67
68
|
contextIdentifierProvider = _propsRef$current.contextIdentifierProvider,
|
|
68
69
|
onEditorReady = _propsRef$current.onEditorReady,
|
|
69
70
|
featureFlags = _propsRef$current.featureFlags;
|
|
71
|
+
editorViewRef.current = instance.view;
|
|
70
72
|
editorActions._privateRegisterEditor(instance.view, instance.eventDispatcher, instance.transformer, getFeatureFlagsFromRef);
|
|
71
73
|
if (onEditorReady) {
|
|
72
74
|
(0, _performanceMeasures.startMeasure)(_measureEnum.default.ON_EDITOR_READY_CALLBACK);
|
|
@@ -79,6 +81,7 @@ function Editor(passedProps) {
|
|
|
79
81
|
}, [editorActions, createAnalyticsEvent, getFeatureFlagsFromRef, propsRef]);
|
|
80
82
|
var onEditorDestroyed = (0, _react.useCallback)(function (_instance) {
|
|
81
83
|
var onDestroy = propsRef.current.onDestroy;
|
|
84
|
+
editorViewRef.current = null;
|
|
82
85
|
editorActions._privateUnregisterEditor();
|
|
83
86
|
if (onDestroy) {
|
|
84
87
|
onDestroy();
|
|
@@ -93,7 +96,9 @@ function Editor(passedProps) {
|
|
|
93
96
|
}
|
|
94
97
|
}, [onSaveFromProps]);
|
|
95
98
|
var isFullPageAppearance = Boolean(props.appearance && ['full-page', 'full-width'].concat((0, _toConsumableArray2.default)((0, _experiments.editorExperiment)('platform_synced_block', true) ? ['max'] : [])).includes(props.appearance));
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, isFullPageAppearance ? /*#__PURE__*/_react.default.createElement(_editorInpMetrics.EditorINPMetrics,
|
|
99
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, isFullPageAppearance ? /*#__PURE__*/_react.default.createElement(_editorInpMetrics.EditorINPMetrics, {
|
|
100
|
+
editorViewRef: editorViewRef
|
|
101
|
+
}) : null, /*#__PURE__*/_react.default.createElement(_editorInternal.EditorInternal, {
|
|
97
102
|
props: props,
|
|
98
103
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
99
104
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
@@ -11,18 +11,28 @@ var _useAnalyticsEvents = require("@atlaskit/analytics-next/useAnalyticsEvents")
|
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _inp = require("@atlaskit/editor-performance-metrics/inp");
|
|
13
13
|
var _interactionMetrics = require("@atlaskit/react-ufo/interaction-metrics");
|
|
14
|
-
var
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
|
+
var _getEditorDomSize = require("../utils/getEditorDomSize");
|
|
16
|
+
var EditorINPMetrics = exports.EditorINPMetrics = function EditorINPMetrics(_ref) {
|
|
17
|
+
var editorViewRef = _ref.editorViewRef;
|
|
15
18
|
var analyticsEvents = (0, _useAnalyticsEvents.useAnalyticsEvents)();
|
|
16
19
|
|
|
17
20
|
// onMount lifecycle hook
|
|
18
21
|
(0, _react.useEffect)(function () {
|
|
19
22
|
var cleanupFn;
|
|
20
23
|
var cleanupIdleCallback = createIdleCallback(function () {
|
|
21
|
-
cleanupFn = (0, _inp.setupINPTracking)(function (
|
|
22
|
-
var value =
|
|
24
|
+
cleanupFn = (0, _inp.setupINPTracking)(function (_ref2) {
|
|
25
|
+
var value = _ref2.value;
|
|
23
26
|
var interaction = (0, _interactionMetrics.getActiveInteraction)();
|
|
24
27
|
var ufoName = interaction === null || interaction === void 0 ? void 0 : interaction.ufoName;
|
|
25
|
-
|
|
28
|
+
var editorDomSize;
|
|
29
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_dom_node_count', 'isEnabled', true)) {
|
|
30
|
+
var editorView = editorViewRef.current;
|
|
31
|
+
if (editorView) {
|
|
32
|
+
editorDomSize = (0, _getEditorDomSize.getEditorDomSize)(editorView);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
sendAnalytics(analyticsEvents.createAnalyticsEvent, value, ufoName, editorDomSize);
|
|
26
36
|
});
|
|
27
37
|
});
|
|
28
38
|
|
|
@@ -40,7 +50,7 @@ var EditorINPMetrics = exports.EditorINPMetrics = function EditorINPMetrics() {
|
|
|
40
50
|
// This component doesn't render anything
|
|
41
51
|
return null;
|
|
42
52
|
};
|
|
43
|
-
var sendAnalytics = (0, _debounce.default)(function (createAnalyticsEvent, value, ufoName) {
|
|
53
|
+
var sendAnalytics = (0, _debounce.default)(function (createAnalyticsEvent, value, ufoName, editorDomSize) {
|
|
44
54
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
45
55
|
payload: {
|
|
46
56
|
// @ts-expect-error Temporary data
|
|
@@ -49,7 +59,8 @@ var sendAnalytics = (0, _debounce.default)(function (createAnalyticsEvent, value
|
|
|
49
59
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
50
60
|
attributes: {
|
|
51
61
|
inp: value,
|
|
52
|
-
ufoName: ufoName
|
|
62
|
+
ufoName: ufoName,
|
|
63
|
+
editorDomSize: editorDomSize
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
});
|
|
@@ -35,12 +35,14 @@ var _editorSsrRenderer = require("@atlaskit/editor-ssr-renderer");
|
|
|
35
35
|
var _createSsrEditorState = require("@atlaskit/editor-ssr-renderer/create-ssr-editor-state");
|
|
36
36
|
var _createSsrPmPlugins = require("@atlaskit/editor-ssr-renderer/create-ssr-pm-plugins");
|
|
37
37
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
38
|
+
var _customData = require("@atlaskit/react-ufo/custom-data");
|
|
38
39
|
var _interactionIdContext = require("@atlaskit/react-ufo/interaction-id-context");
|
|
39
40
|
var _interactionMetrics = require("@atlaskit/react-ufo/interaction-metrics");
|
|
40
41
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
41
42
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
42
43
|
var _useProviders = require("../composable-editor/hooks/useProviders");
|
|
43
44
|
var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
|
|
45
|
+
var _getEditorDomSize = require("../utils/getEditorDomSize");
|
|
44
46
|
var _getNodesCountWithExtensionKeys = require("../utils/getNodesCountWithExtensionKeys");
|
|
45
47
|
var _getNodesVisibleInViewport = require("../utils/getNodesVisibleInViewport");
|
|
46
48
|
var _isChromeless = require("../utils/is-chromeless");
|
|
@@ -733,6 +735,7 @@ function ReactEditorView(props) {
|
|
|
733
735
|
} : {},
|
|
734
736
|
totalNodes = _ref4.totalNodes,
|
|
735
737
|
nodeSizeBucket = _ref4.nodeSizeBucket;
|
|
738
|
+
var editorDomSize = (0, _expValEquals.expValEquals)('platform_editor_dom_node_count', 'isEnabled', true) ? (0, _getEditorDomSize.getEditorDomSize)(viewRef.current) : undefined;
|
|
736
739
|
var interaction = (0, _interactionMetrics.getActiveInteraction)();
|
|
737
740
|
var pageLoadType = interaction === null || interaction === void 0 ? void 0 : interaction.type;
|
|
738
741
|
var pageType = interaction === null || interaction === void 0 ? void 0 : interaction.routeName;
|
|
@@ -757,6 +760,7 @@ function ReactEditorView(props) {
|
|
|
757
760
|
nodeSize: nodeSize,
|
|
758
761
|
nodeSizeBucket: nodeSizeBucket,
|
|
759
762
|
totalNodes: totalNodes,
|
|
763
|
+
editorDomSize: editorDomSize,
|
|
760
764
|
ttfb: ttfb,
|
|
761
765
|
severity: proseMirrorRenderedSeverity,
|
|
762
766
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -767,6 +771,11 @@ function ReactEditorView(props) {
|
|
|
767
771
|
extensionKeys: extensionKeys,
|
|
768
772
|
ufoInteractionId: (0, _interactionIdContext.getInteractionId)().current
|
|
769
773
|
};
|
|
774
|
+
if (editorDomSize !== undefined) {
|
|
775
|
+
(0, _customData.addUFOCustomData)({
|
|
776
|
+
editorDomSize: editorDomSize
|
|
777
|
+
});
|
|
778
|
+
}
|
|
770
779
|
dispatchAnalyticsEvent({
|
|
771
780
|
action: _analytics.ACTION.PROSEMIRROR_RENDERED,
|
|
772
781
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.ContextPanelWrapperCompiled = exports.ContextPanelContentCompiled = void 0;
|
|
10
10
|
require("./index-compiled.compiled.css");
|
|
11
|
-
var
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
12
13
|
var _runtime = require("@compiled/react/runtime");
|
|
13
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -23,46 +24,68 @@ var _excluded = ["children", "customWidth", "visible", "disableAnimation"],
|
|
|
23
24
|
*/
|
|
24
25
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
25
26
|
var ANIM_SPEED_MS = 500;
|
|
27
|
+
var getContextPanelWidthStyle = function getContextPanelWidthStyle(_ref) {
|
|
28
|
+
var customWidth = _ref.customWidth,
|
|
29
|
+
visible = _ref.visible;
|
|
30
|
+
if (!visible) {
|
|
31
|
+
return {
|
|
32
|
+
width: 0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (customWidth) {
|
|
36
|
+
return {
|
|
37
|
+
width: "".concat(customWidth, "px")
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
26
42
|
var panelStyles = {
|
|
27
43
|
panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
|
|
28
|
-
panelHidden: "_1bsbidpf",
|
|
29
44
|
disablePanelAnimation: "_v564glyw",
|
|
30
45
|
content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
|
|
31
46
|
padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
|
|
32
47
|
customWidthOverflow: "_1reo15vq"
|
|
33
48
|
};
|
|
34
|
-
var ContextPanelWrapperCompiled = exports.ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(
|
|
35
|
-
var children =
|
|
36
|
-
customWidth =
|
|
37
|
-
visible =
|
|
38
|
-
disableAnimation =
|
|
39
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
49
|
+
var ContextPanelWrapperCompiled = exports.ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref2) {
|
|
50
|
+
var children = _ref2.children,
|
|
51
|
+
customWidth = _ref2.customWidth,
|
|
52
|
+
visible = _ref2.visible,
|
|
53
|
+
disableAnimation = _ref2.disableAnimation,
|
|
54
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
55
|
+
var widthStyle = (0, _react.useMemo)(function () {
|
|
56
|
+
return getContextPanelWidthStyle({
|
|
57
|
+
customWidth: customWidth,
|
|
58
|
+
visible: visible
|
|
59
|
+
});
|
|
60
|
+
}, [customWidth, visible]);
|
|
40
61
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
41
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
42
|
-
style:
|
|
43
|
-
width: "".concat(customWidth, "px")
|
|
44
|
-
} : undefined
|
|
63
|
+
style: widthStyle
|
|
45
64
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
46
65
|
}, rest, {
|
|
47
|
-
className: (0, _runtime.ax)([panelStyles.panel, customWidth && "",
|
|
66
|
+
className: (0, _runtime.ax)([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
48
67
|
}), children);
|
|
49
68
|
};
|
|
50
69
|
|
|
51
70
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
52
|
-
var ContextPanelContentCompiled = exports.ContextPanelContentCompiled = function ContextPanelContentCompiled(
|
|
53
|
-
var children =
|
|
54
|
-
customWidth =
|
|
55
|
-
visible =
|
|
56
|
-
disableAnimation =
|
|
57
|
-
hasPadding =
|
|
58
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
71
|
+
var ContextPanelContentCompiled = exports.ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref3) {
|
|
72
|
+
var children = _ref3.children,
|
|
73
|
+
customWidth = _ref3.customWidth,
|
|
74
|
+
visible = _ref3.visible,
|
|
75
|
+
disableAnimation = _ref3.disableAnimation,
|
|
76
|
+
hasPadding = _ref3.hasPadding,
|
|
77
|
+
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
|
|
78
|
+
var widthStyle = (0, _react.useMemo)(function () {
|
|
79
|
+
return getContextPanelWidthStyle({
|
|
80
|
+
customWidth: customWidth,
|
|
81
|
+
visible: visible
|
|
82
|
+
});
|
|
83
|
+
}, [customWidth, visible]);
|
|
59
84
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
60
85
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
61
|
-
style:
|
|
62
|
-
width: "".concat(customWidth, "px")
|
|
63
|
-
} : undefined
|
|
86
|
+
style: widthStyle
|
|
64
87
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
65
88
|
}, rest, {
|
|
66
|
-
className: (0, _runtime.ax)([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "",
|
|
89
|
+
className: (0, _runtime.ax)([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
67
90
|
}), children);
|
|
68
91
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getEditorDomSize = getEditorDomSize;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the total number of DOM elements inside the editor's content DOM,
|
|
9
|
+
* used as a proxy for document complexity in performance events.
|
|
10
|
+
*
|
|
11
|
+
* Uses the native `getElementsByTagName('*')`, which counts descendants
|
|
12
|
+
* iteratively in the browser engine — intentionally not a recursive JS walk, so
|
|
13
|
+
* it can't overflow the stack on very large documents.
|
|
14
|
+
*/
|
|
15
|
+
function getEditorDomSize(view) {
|
|
16
|
+
return view.dom.getElementsByTagName('*').length;
|
|
17
|
+
}
|
|
@@ -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 = "221.
|
|
9
|
+
var version = exports.version = "221.9.0";
|
|
@@ -40,6 +40,7 @@ function Editor(passedProps) {
|
|
|
40
40
|
const {
|
|
41
41
|
createAnalyticsEvent
|
|
42
42
|
} = useAnalyticsEvents();
|
|
43
|
+
const editorViewRef = useRef(null);
|
|
43
44
|
const handleAnalyticsEvent = useCallback(data => {
|
|
44
45
|
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
45
46
|
}, [createAnalyticsEvent]);
|
|
@@ -56,6 +57,7 @@ function Editor(passedProps) {
|
|
|
56
57
|
onEditorReady,
|
|
57
58
|
featureFlags
|
|
58
59
|
} = propsRef.current;
|
|
60
|
+
editorViewRef.current = instance.view;
|
|
59
61
|
editorActions._privateRegisterEditor(instance.view, instance.eventDispatcher, instance.transformer, getFeatureFlagsFromRef);
|
|
60
62
|
if (onEditorReady) {
|
|
61
63
|
startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
@@ -70,6 +72,7 @@ function Editor(passedProps) {
|
|
|
70
72
|
const {
|
|
71
73
|
onDestroy
|
|
72
74
|
} = propsRef.current;
|
|
75
|
+
editorViewRef.current = null;
|
|
73
76
|
editorActions._privateUnregisterEditor();
|
|
74
77
|
if (onDestroy) {
|
|
75
78
|
onDestroy();
|
|
@@ -86,7 +89,9 @@ function Editor(passedProps) {
|
|
|
86
89
|
}
|
|
87
90
|
}, [onSaveFromProps]);
|
|
88
91
|
const isFullPageAppearance = Boolean(props.appearance && ['full-page', 'full-width', ...(editorExperiment('platform_synced_block', true) ? ['max'] : [])].includes(props.appearance));
|
|
89
|
-
return /*#__PURE__*/React.createElement(Fragment, null, isFullPageAppearance ? /*#__PURE__*/React.createElement(EditorINPMetrics,
|
|
92
|
+
return /*#__PURE__*/React.createElement(Fragment, null, isFullPageAppearance ? /*#__PURE__*/React.createElement(EditorINPMetrics, {
|
|
93
|
+
editorViewRef: editorViewRef
|
|
94
|
+
}) : null, /*#__PURE__*/React.createElement(EditorInternal, {
|
|
90
95
|
props: props,
|
|
91
96
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
92
97
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
@@ -4,7 +4,11 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents'
|
|
|
4
4
|
import { ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { setupINPTracking } from '@atlaskit/editor-performance-metrics/inp';
|
|
6
6
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
7
|
-
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
import { getEditorDomSize } from '../utils/getEditorDomSize';
|
|
9
|
+
export const EditorINPMetrics = ({
|
|
10
|
+
editorViewRef
|
|
11
|
+
}) => {
|
|
8
12
|
const analyticsEvents = useAnalyticsEvents();
|
|
9
13
|
|
|
10
14
|
// onMount lifecycle hook
|
|
@@ -16,7 +20,14 @@ export const EditorINPMetrics = () => {
|
|
|
16
20
|
}) => {
|
|
17
21
|
const interaction = getActiveInteraction();
|
|
18
22
|
const ufoName = interaction === null || interaction === void 0 ? void 0 : interaction.ufoName;
|
|
19
|
-
|
|
23
|
+
let editorDomSize;
|
|
24
|
+
if (expValEquals('platform_editor_dom_node_count', 'isEnabled', true)) {
|
|
25
|
+
const editorView = editorViewRef.current;
|
|
26
|
+
if (editorView) {
|
|
27
|
+
editorDomSize = getEditorDomSize(editorView);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
sendAnalytics(analyticsEvents.createAnalyticsEvent, value, ufoName, editorDomSize);
|
|
20
31
|
});
|
|
21
32
|
});
|
|
22
33
|
|
|
@@ -34,7 +45,7 @@ export const EditorINPMetrics = () => {
|
|
|
34
45
|
// This component doesn't render anything
|
|
35
46
|
return null;
|
|
36
47
|
};
|
|
37
|
-
const sendAnalytics = debounce((createAnalyticsEvent, value, ufoName) => {
|
|
48
|
+
const sendAnalytics = debounce((createAnalyticsEvent, value, ufoName, editorDomSize) => {
|
|
38
49
|
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
39
50
|
payload: {
|
|
40
51
|
// @ts-expect-error Temporary data
|
|
@@ -43,7 +54,8 @@ const sendAnalytics = debounce((createAnalyticsEvent, value, ufoName) => {
|
|
|
43
54
|
eventType: EVENT_TYPE.TRACK,
|
|
44
55
|
attributes: {
|
|
45
56
|
inp: value,
|
|
46
|
-
ufoName
|
|
57
|
+
ufoName,
|
|
58
|
+
editorDomSize
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
});
|
|
@@ -24,12 +24,14 @@ import { EditorSSRRenderer } from '@atlaskit/editor-ssr-renderer';
|
|
|
24
24
|
import { createSSREditorState } from '@atlaskit/editor-ssr-renderer/create-ssr-editor-state';
|
|
25
25
|
import { createSSRPMPlugins } from '@atlaskit/editor-ssr-renderer/create-ssr-pm-plugins';
|
|
26
26
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
|
+
import { addUFOCustomData } from '@atlaskit/react-ufo/custom-data';
|
|
27
28
|
import { getInteractionId } from '@atlaskit/react-ufo/interaction-id-context';
|
|
28
29
|
import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
29
30
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
30
31
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
31
32
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
32
33
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
34
|
+
import { getEditorDomSize } from '../utils/getEditorDomSize';
|
|
33
35
|
import { getNodesCountWithExtensionKeys } from '../utils/getNodesCountWithExtensionKeys';
|
|
34
36
|
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
35
37
|
import { isChromeless } from '../utils/is-chromeless';
|
|
@@ -684,6 +686,7 @@ export function ReactEditorView(props) {
|
|
|
684
686
|
}
|
|
685
687
|
})()
|
|
686
688
|
} : {};
|
|
689
|
+
const editorDomSize = expValEquals('platform_editor_dom_node_count', 'isEnabled', true) ? getEditorDomSize(viewRef.current) : undefined;
|
|
687
690
|
const interaction = getActiveInteraction();
|
|
688
691
|
const pageLoadType = interaction === null || interaction === void 0 ? void 0 : interaction.type;
|
|
689
692
|
const pageType = interaction === null || interaction === void 0 ? void 0 : interaction.routeName;
|
|
@@ -708,6 +711,7 @@ export function ReactEditorView(props) {
|
|
|
708
711
|
nodeSize,
|
|
709
712
|
nodeSizeBucket,
|
|
710
713
|
totalNodes,
|
|
714
|
+
editorDomSize,
|
|
711
715
|
ttfb,
|
|
712
716
|
severity: proseMirrorRenderedSeverity,
|
|
713
717
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -718,6 +722,11 @@ export function ReactEditorView(props) {
|
|
|
718
722
|
extensionKeys,
|
|
719
723
|
ufoInteractionId: getInteractionId().current
|
|
720
724
|
};
|
|
725
|
+
if (editorDomSize !== undefined) {
|
|
726
|
+
addUFOCustomData({
|
|
727
|
+
editorDomSize
|
|
728
|
+
});
|
|
729
|
+
}
|
|
721
730
|
dispatchAnalyticsEvent({
|
|
722
731
|
action: ACTION.PROSEMIRROR_RENDERED,
|
|
723
732
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -9,12 +9,27 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
9
9
|
*
|
|
10
10
|
* Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
import { useMemo } from 'react';
|
|
13
13
|
import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
const ANIM_SPEED_MS = 500;
|
|
15
|
+
const getContextPanelWidthStyle = ({
|
|
16
|
+
customWidth,
|
|
17
|
+
visible
|
|
18
|
+
}) => {
|
|
19
|
+
if (!visible) {
|
|
20
|
+
return {
|
|
21
|
+
width: 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (customWidth) {
|
|
25
|
+
return {
|
|
26
|
+
width: `${customWidth}px`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
};
|
|
15
31
|
const panelStyles = {
|
|
16
32
|
panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
|
|
17
|
-
panelHidden: "_1bsbidpf",
|
|
18
33
|
disablePanelAnimation: "_v564glyw",
|
|
19
34
|
content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
|
|
20
35
|
padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
|
|
@@ -26,15 +41,19 @@ export const ContextPanelWrapperCompiled = ({
|
|
|
26
41
|
visible,
|
|
27
42
|
disableAnimation,
|
|
28
43
|
...rest
|
|
29
|
-
}) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
}) => {
|
|
45
|
+
const widthStyle = useMemo(() => getContextPanelWidthStyle({
|
|
46
|
+
customWidth,
|
|
47
|
+
visible
|
|
48
|
+
}), [customWidth, visible]);
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
51
|
+
style: widthStyle
|
|
52
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
53
|
+
}, rest, {
|
|
54
|
+
className: ax([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
55
|
+
}), children);
|
|
56
|
+
};
|
|
38
57
|
|
|
39
58
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
40
59
|
export const ContextPanelContentCompiled = ({
|
|
@@ -44,12 +63,16 @@ export const ContextPanelContentCompiled = ({
|
|
|
44
63
|
disableAnimation,
|
|
45
64
|
hasPadding,
|
|
46
65
|
...rest
|
|
47
|
-
}) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
}) => {
|
|
67
|
+
const widthStyle = useMemo(() => getContextPanelWidthStyle({
|
|
68
|
+
customWidth,
|
|
69
|
+
visible
|
|
70
|
+
}), [customWidth, visible]);
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
73
|
+
style: widthStyle
|
|
74
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
75
|
+
}, rest, {
|
|
76
|
+
className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
77
|
+
}), children);
|
|
78
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the total number of DOM elements inside the editor's content DOM,
|
|
3
|
+
* used as a proxy for document complexity in performance events.
|
|
4
|
+
*
|
|
5
|
+
* Uses the native `getElementsByTagName('*')`, which counts descendants
|
|
6
|
+
* iteratively in the browser engine — intentionally not a recursive JS walk, so
|
|
7
|
+
* it can't overflow the stack on very large documents.
|
|
8
|
+
*/
|
|
9
|
+
export function getEditorDomSize(view) {
|
|
10
|
+
return view.dom.getElementsByTagName('*').length;
|
|
11
|
+
}
|
|
@@ -45,6 +45,7 @@ function Editor(passedProps) {
|
|
|
45
45
|
var editorActions = editorContext.editorActions || editorActionsPlaceholderInstance;
|
|
46
46
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
47
47
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
48
|
+
var editorViewRef = useRef(null);
|
|
48
49
|
var handleAnalyticsEvent = useCallback(function (data) {
|
|
49
50
|
fireAnalyticsEvent(createAnalyticsEvent)(data);
|
|
50
51
|
}, [createAnalyticsEvent]);
|
|
@@ -59,6 +60,7 @@ function Editor(passedProps) {
|
|
|
59
60
|
contextIdentifierProvider = _propsRef$current.contextIdentifierProvider,
|
|
60
61
|
onEditorReady = _propsRef$current.onEditorReady,
|
|
61
62
|
featureFlags = _propsRef$current.featureFlags;
|
|
63
|
+
editorViewRef.current = instance.view;
|
|
62
64
|
editorActions._privateRegisterEditor(instance.view, instance.eventDispatcher, instance.transformer, getFeatureFlagsFromRef);
|
|
63
65
|
if (onEditorReady) {
|
|
64
66
|
startMeasure(measurements.ON_EDITOR_READY_CALLBACK);
|
|
@@ -71,6 +73,7 @@ function Editor(passedProps) {
|
|
|
71
73
|
}, [editorActions, createAnalyticsEvent, getFeatureFlagsFromRef, propsRef]);
|
|
72
74
|
var onEditorDestroyed = useCallback(function (_instance) {
|
|
73
75
|
var onDestroy = propsRef.current.onDestroy;
|
|
76
|
+
editorViewRef.current = null;
|
|
74
77
|
editorActions._privateUnregisterEditor();
|
|
75
78
|
if (onDestroy) {
|
|
76
79
|
onDestroy();
|
|
@@ -85,7 +88,9 @@ function Editor(passedProps) {
|
|
|
85
88
|
}
|
|
86
89
|
}, [onSaveFromProps]);
|
|
87
90
|
var isFullPageAppearance = Boolean(props.appearance && ['full-page', 'full-width'].concat(_toConsumableArray(editorExperiment('platform_synced_block', true) ? ['max'] : [])).includes(props.appearance));
|
|
88
|
-
return /*#__PURE__*/React.createElement(Fragment, null, isFullPageAppearance ? /*#__PURE__*/React.createElement(EditorINPMetrics,
|
|
91
|
+
return /*#__PURE__*/React.createElement(Fragment, null, isFullPageAppearance ? /*#__PURE__*/React.createElement(EditorINPMetrics, {
|
|
92
|
+
editorViewRef: editorViewRef
|
|
93
|
+
}) : null, /*#__PURE__*/React.createElement(EditorInternal, {
|
|
89
94
|
props: props,
|
|
90
95
|
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
91
96
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
@@ -4,18 +4,28 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents'
|
|
|
4
4
|
import { ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { setupINPTracking } from '@atlaskit/editor-performance-metrics/inp';
|
|
6
6
|
import { getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
7
|
-
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
import { getEditorDomSize } from '../utils/getEditorDomSize';
|
|
9
|
+
export var EditorINPMetrics = function EditorINPMetrics(_ref) {
|
|
10
|
+
var editorViewRef = _ref.editorViewRef;
|
|
8
11
|
var analyticsEvents = useAnalyticsEvents();
|
|
9
12
|
|
|
10
13
|
// onMount lifecycle hook
|
|
11
14
|
useEffect(function () {
|
|
12
15
|
var cleanupFn;
|
|
13
16
|
var cleanupIdleCallback = createIdleCallback(function () {
|
|
14
|
-
cleanupFn = setupINPTracking(function (
|
|
15
|
-
var value =
|
|
17
|
+
cleanupFn = setupINPTracking(function (_ref2) {
|
|
18
|
+
var value = _ref2.value;
|
|
16
19
|
var interaction = getActiveInteraction();
|
|
17
20
|
var ufoName = interaction === null || interaction === void 0 ? void 0 : interaction.ufoName;
|
|
18
|
-
|
|
21
|
+
var editorDomSize;
|
|
22
|
+
if (expValEquals('platform_editor_dom_node_count', 'isEnabled', true)) {
|
|
23
|
+
var editorView = editorViewRef.current;
|
|
24
|
+
if (editorView) {
|
|
25
|
+
editorDomSize = getEditorDomSize(editorView);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
sendAnalytics(analyticsEvents.createAnalyticsEvent, value, ufoName, editorDomSize);
|
|
19
29
|
});
|
|
20
30
|
});
|
|
21
31
|
|
|
@@ -33,7 +43,7 @@ export var EditorINPMetrics = function EditorINPMetrics() {
|
|
|
33
43
|
// This component doesn't render anything
|
|
34
44
|
return null;
|
|
35
45
|
};
|
|
36
|
-
var sendAnalytics = debounce(function (createAnalyticsEvent, value, ufoName) {
|
|
46
|
+
var sendAnalytics = debounce(function (createAnalyticsEvent, value, ufoName, editorDomSize) {
|
|
37
47
|
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
38
48
|
payload: {
|
|
39
49
|
// @ts-expect-error Temporary data
|
|
@@ -42,7 +52,8 @@ var sendAnalytics = debounce(function (createAnalyticsEvent, value, ufoName) {
|
|
|
42
52
|
eventType: EVENT_TYPE.TRACK,
|
|
43
53
|
attributes: {
|
|
44
54
|
inp: value,
|
|
45
|
-
ufoName: ufoName
|
|
55
|
+
ufoName: ufoName,
|
|
56
|
+
editorDomSize: editorDomSize
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
});
|
|
@@ -32,12 +32,14 @@ import { EditorSSRRenderer } from '@atlaskit/editor-ssr-renderer';
|
|
|
32
32
|
import { createSSREditorState } from '@atlaskit/editor-ssr-renderer/create-ssr-editor-state';
|
|
33
33
|
import { createSSRPMPlugins } from '@atlaskit/editor-ssr-renderer/create-ssr-pm-plugins';
|
|
34
34
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
35
|
+
import { addUFOCustomData } from '@atlaskit/react-ufo/custom-data';
|
|
35
36
|
import { getInteractionId } from '@atlaskit/react-ufo/interaction-id-context';
|
|
36
37
|
import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
37
38
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
38
39
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
39
40
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
40
41
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
42
|
+
import { getEditorDomSize } from '../utils/getEditorDomSize';
|
|
41
43
|
import { getNodesCountWithExtensionKeys } from '../utils/getNodesCountWithExtensionKeys';
|
|
42
44
|
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
43
45
|
import { isChromeless } from '../utils/is-chromeless';
|
|
@@ -724,6 +726,7 @@ export function ReactEditorView(props) {
|
|
|
724
726
|
} : {},
|
|
725
727
|
totalNodes = _ref4.totalNodes,
|
|
726
728
|
nodeSizeBucket = _ref4.nodeSizeBucket;
|
|
729
|
+
var editorDomSize = expValEquals('platform_editor_dom_node_count', 'isEnabled', true) ? getEditorDomSize(viewRef.current) : undefined;
|
|
727
730
|
var interaction = getActiveInteraction();
|
|
728
731
|
var pageLoadType = interaction === null || interaction === void 0 ? void 0 : interaction.type;
|
|
729
732
|
var pageType = interaction === null || interaction === void 0 ? void 0 : interaction.routeName;
|
|
@@ -748,6 +751,7 @@ export function ReactEditorView(props) {
|
|
|
748
751
|
nodeSize: nodeSize,
|
|
749
752
|
nodeSizeBucket: nodeSizeBucket,
|
|
750
753
|
totalNodes: totalNodes,
|
|
754
|
+
editorDomSize: editorDomSize,
|
|
751
755
|
ttfb: ttfb,
|
|
752
756
|
severity: proseMirrorRenderedSeverity,
|
|
753
757
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -758,6 +762,11 @@ export function ReactEditorView(props) {
|
|
|
758
762
|
extensionKeys: extensionKeys,
|
|
759
763
|
ufoInteractionId: getInteractionId().current
|
|
760
764
|
};
|
|
765
|
+
if (editorDomSize !== undefined) {
|
|
766
|
+
addUFOCustomData({
|
|
767
|
+
editorDomSize: editorDomSize
|
|
768
|
+
});
|
|
769
|
+
}
|
|
761
770
|
dispatchAnalyticsEvent({
|
|
762
771
|
action: ACTION.PROSEMIRROR_RENDERED,
|
|
763
772
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -12,49 +12,71 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
12
12
|
*
|
|
13
13
|
* Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
import { useMemo } from 'react';
|
|
16
16
|
import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
var ANIM_SPEED_MS = 500;
|
|
18
|
+
var getContextPanelWidthStyle = function getContextPanelWidthStyle(_ref) {
|
|
19
|
+
var customWidth = _ref.customWidth,
|
|
20
|
+
visible = _ref.visible;
|
|
21
|
+
if (!visible) {
|
|
22
|
+
return {
|
|
23
|
+
width: 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (customWidth) {
|
|
27
|
+
return {
|
|
28
|
+
width: "".concat(customWidth, "px")
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
18
33
|
var panelStyles = {
|
|
19
34
|
panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
|
|
20
|
-
panelHidden: "_1bsbidpf",
|
|
21
35
|
disablePanelAnimation: "_v564glyw",
|
|
22
36
|
content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
|
|
23
37
|
padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
|
|
24
38
|
customWidthOverflow: "_1reo15vq"
|
|
25
39
|
};
|
|
26
|
-
export var ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(
|
|
27
|
-
var children =
|
|
28
|
-
customWidth =
|
|
29
|
-
visible =
|
|
30
|
-
disableAnimation =
|
|
31
|
-
rest = _objectWithoutProperties(
|
|
40
|
+
export var ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref2) {
|
|
41
|
+
var children = _ref2.children,
|
|
42
|
+
customWidth = _ref2.customWidth,
|
|
43
|
+
visible = _ref2.visible,
|
|
44
|
+
disableAnimation = _ref2.disableAnimation,
|
|
45
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
46
|
+
var widthStyle = useMemo(function () {
|
|
47
|
+
return getContextPanelWidthStyle({
|
|
48
|
+
customWidth: customWidth,
|
|
49
|
+
visible: visible
|
|
50
|
+
});
|
|
51
|
+
}, [customWidth, visible]);
|
|
32
52
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
33
53
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
34
|
-
style:
|
|
35
|
-
width: "".concat(customWidth, "px")
|
|
36
|
-
} : undefined
|
|
54
|
+
style: widthStyle
|
|
37
55
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
38
56
|
}, rest, {
|
|
39
|
-
className: ax([panelStyles.panel, customWidth && "",
|
|
57
|
+
className: ax([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
40
58
|
}), children);
|
|
41
59
|
};
|
|
42
60
|
|
|
43
61
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
44
|
-
export var ContextPanelContentCompiled = function ContextPanelContentCompiled(
|
|
45
|
-
var children =
|
|
46
|
-
customWidth =
|
|
47
|
-
visible =
|
|
48
|
-
disableAnimation =
|
|
49
|
-
hasPadding =
|
|
50
|
-
rest = _objectWithoutProperties(
|
|
62
|
+
export var ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref3) {
|
|
63
|
+
var children = _ref3.children,
|
|
64
|
+
customWidth = _ref3.customWidth,
|
|
65
|
+
visible = _ref3.visible,
|
|
66
|
+
disableAnimation = _ref3.disableAnimation,
|
|
67
|
+
hasPadding = _ref3.hasPadding,
|
|
68
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
69
|
+
var widthStyle = useMemo(function () {
|
|
70
|
+
return getContextPanelWidthStyle({
|
|
71
|
+
customWidth: customWidth,
|
|
72
|
+
visible: visible
|
|
73
|
+
});
|
|
74
|
+
}, [customWidth, visible]);
|
|
51
75
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
52
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
|
|
53
|
-
style:
|
|
54
|
-
width: "".concat(customWidth, "px")
|
|
55
|
-
} : undefined
|
|
77
|
+
style: widthStyle
|
|
56
78
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
57
79
|
}, rest, {
|
|
58
|
-
className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "",
|
|
80
|
+
className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
|
|
59
81
|
}), children);
|
|
60
82
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the total number of DOM elements inside the editor's content DOM,
|
|
3
|
+
* used as a proxy for document complexity in performance events.
|
|
4
|
+
*
|
|
5
|
+
* Uses the native `getElementsByTagName('*')`, which counts descendants
|
|
6
|
+
* iteratively in the browser engine — intentionally not a recursive JS walk, so
|
|
7
|
+
* it can't overflow the stack on very large documents.
|
|
8
|
+
*/
|
|
9
|
+
export function getEditorDomSize(view) {
|
|
10
|
+
return view.dom.getElementsByTagName('*').length;
|
|
11
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
type EditorINPMetricsProps = {
|
|
4
|
+
editorViewRef: RefObject<EditorView | null>;
|
|
5
|
+
};
|
|
6
|
+
export declare const EditorINPMetrics: ({ editorViewRef }: EditorINPMetricsProps) => null;
|
|
7
|
+
export {};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
* Compiled migration: platform_editor_core_non_ecc_static_css
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
8
|
-
* Used via `componentWithCondition` in `index.tsx`.
|
|
9
|
-
*
|
|
10
|
-
* Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
|
|
11
|
-
*/
|
|
12
1
|
import type { HTMLAttributes } from 'react';
|
|
13
2
|
export interface ContextPanelWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
3
|
customWidth?: number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the total number of DOM elements inside the editor's content DOM,
|
|
4
|
+
* used as a proxy for document complexity in performance events.
|
|
5
|
+
*
|
|
6
|
+
* Uses the native `getElementsByTagName('*')`, which counts descendants
|
|
7
|
+
* iteratively in the browser engine — intentionally not a recursive JS walk, so
|
|
8
|
+
* it can't overflow the stack on very large documents.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getEditorDomSize(view: EditorView): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "221.
|
|
3
|
+
"version": "221.9.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@atlaskit/react-ufo": "^7.3.0",
|
|
69
69
|
"@atlaskit/task-decision": "^21.4.0",
|
|
70
70
|
"@atlaskit/tmp-editor-statsig": "^124.2.0",
|
|
71
|
-
"@atlaskit/tokens": "^15.
|
|
71
|
+
"@atlaskit/tokens": "^15.7.0",
|
|
72
72
|
"@atlaskit/tooltip": "^23.1.0",
|
|
73
73
|
"@atlaskit/width-detector": "^6.2.0",
|
|
74
74
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"uuid": "^3.1.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^116.
|
|
88
|
+
"@atlaskit/editor-common": "^116.27.0",
|
|
89
89
|
"@atlaskit/link-provider": "^5.2.0",
|
|
90
90
|
"@atlaskit/media-core": "^38.0.0",
|
|
91
91
|
"react": "^18.2.0",
|