@atlaskit/editor-core 211.2.0 → 211.2.2
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 +16 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -0
- package/dist/cjs/ui/Addon/Dropdown/styles.js +1 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/cjs/ui/ContentStyles/code-bidi-warning.js +1 -1
- package/dist/cjs/ui/ContentStyles/layout.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/styles/codeBidiWarningStyles.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/styles/codeBlockStyles.js +3 -3
- package/dist/cjs/ui/EditorContentContainer/styles/codeMarkStyles.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/styles/layout.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/styles/panelStyles.js +1 -1
- package/dist/cjs/utils/getNodesVisibleInViewport.js +42 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +3 -0
- package/dist/es2019/ui/Addon/Dropdown/styles.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/es2019/ui/ContentStyles/code-bidi-warning.js +1 -1
- package/dist/es2019/ui/ContentStyles/layout.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/styles/codeBidiWarningStyles.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/styles/codeBlockStyles.js +3 -3
- package/dist/es2019/ui/EditorContentContainer/styles/codeMarkStyles.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/styles/layout.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/styles/panelStyles.js +1 -1
- package/dist/es2019/utils/getNodesVisibleInViewport.js +36 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +3 -0
- package/dist/esm/ui/Addon/Dropdown/styles.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/esm/ui/ContentStyles/code-bidi-warning.js +1 -1
- package/dist/esm/ui/ContentStyles/layout.js +1 -1
- package/dist/esm/ui/EditorContentContainer/styles/codeBidiWarningStyles.js +1 -1
- package/dist/esm/ui/EditorContentContainer/styles/codeBlockStyles.js +3 -3
- package/dist/esm/ui/EditorContentContainer/styles/codeMarkStyles.js +1 -1
- package/dist/esm/ui/EditorContentContainer/styles/layout.js +1 -1
- package/dist/esm/ui/EditorContentContainer/styles/panelStyles.js +1 -1
- package/dist/esm/utils/getNodesVisibleInViewport.js +36 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +1 -2
- package/dist/types/utils/getNodesVisibleInViewport.d.ts +10 -0
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +1 -2
- package/dist/types-ts4.5/utils/getNodesVisibleInViewport.d.ts +10 -0
- package/package.json +14 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 211.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5c1589424fcc4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c1589424fcc4) -
|
|
8
|
+
ED-29088 - Add nodesInViewport metric to proseMirrorRendered events.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 211.2.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`255837cfba315`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/255837cfba315) -
|
|
16
|
+
Internal changes to how border radius is applied.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 211.2.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -35,6 +35,7 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
|
35
35
|
var _useProviders = require("../composable-editor/hooks/useProviders");
|
|
36
36
|
var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
|
|
37
37
|
var _getNodesCount = require("../utils/getNodesCount");
|
|
38
|
+
var _getNodesVisibleInViewport = require("../utils/getNodesVisibleInViewport");
|
|
38
39
|
var _isFullPage = require("../utils/is-full-page");
|
|
39
40
|
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
40
41
|
var _measureEnum = _interopRequireDefault(require("../utils/performance/measure-enum"));
|
|
@@ -475,6 +476,7 @@ function ReactEditorView(props) {
|
|
|
475
476
|
var nodes = (0, _getNodesCount.getNodesCount)(viewRef.current.state.doc);
|
|
476
477
|
var ttfb = (0, _navigation.getResponseEndTime)();
|
|
477
478
|
var contextIdentifier = (_pluginInjectionAPI$c2 = pluginInjectionAPI.current.api().base) === null || _pluginInjectionAPI$c2 === void 0 ? void 0 : _pluginInjectionAPI$c2.sharedState.currentState();
|
|
479
|
+
var nodesInViewport = (0, _expValEquals.expValEquals)('platform_editor_ttvc_nodes_in_viewport', 'isEnabled', true) ? (0, _getNodesVisibleInViewport.getNodesVisibleInViewport)(viewRef.current.dom) : {};
|
|
478
480
|
dispatchAnalyticsEvent({
|
|
479
481
|
action: _analytics.ACTION.PROSEMIRROR_RENDERED,
|
|
480
482
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
@@ -482,6 +484,7 @@ function ReactEditorView(props) {
|
|
|
482
484
|
duration: duration,
|
|
483
485
|
startTime: startTime,
|
|
484
486
|
nodes: nodes,
|
|
487
|
+
nodesInViewport: nodesInViewport,
|
|
485
488
|
ttfb: ttfb,
|
|
486
489
|
severity: proseMirrorRenderedSeverity,
|
|
487
490
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -13,7 +13,7 @@ var dropdown = exports.dropdown = (0, _react.css)({
|
|
|
13
13
|
flexDirection: 'column',
|
|
14
14
|
background: "var(--ds-surface-overlay, white)",
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
16
|
-
borderRadius: "var(--ds-
|
|
16
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
17
17
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)",
|
|
18
18
|
boxSizing: 'border-box',
|
|
19
19
|
padding: "var(--ds-space-050, 4px)".concat(" 0")
|
|
@@ -59,7 +59,7 @@ var commentEditorStyles = (0, _react2.css)({
|
|
|
59
59
|
border: "1px solid ".concat("var(--ds-border-input, #8590A2)"),
|
|
60
60
|
boxSizing: 'border-box',
|
|
61
61
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
62
|
-
borderRadius: "var(--ds-
|
|
62
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
63
63
|
maxWidth: 'inherit',
|
|
64
64
|
wordWrap: 'break-word'
|
|
65
65
|
});
|
|
@@ -16,7 +16,7 @@ var inputStyle = exports.inputStyle = (0, _react.css)({
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
17
17
|
border: "1px solid ".concat("var(--ds-border-input, ".concat(_editorSharedStyles.akEditorSubtleAccent, ")")),
|
|
18
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
|
-
borderRadius: "var(--ds-
|
|
19
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
20
20
|
boxSizing: 'border-box',
|
|
21
21
|
height: '40px',
|
|
22
22
|
paddingLeft: "var(--ds-space-250, 20px)",
|
|
@@ -41,7 +41,7 @@ var codeBidiWarningStyles = exports.codeBidiWarningStyles = (0, _react.css)({
|
|
|
41
41
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
42
42
|
overflowWrap: 'break-word',
|
|
43
43
|
cursor: 'default',
|
|
44
|
-
borderRadius: "var(--ds-
|
|
44
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
45
45
|
margin: "var(--ds-space-0, 0px)",
|
|
46
46
|
padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
47
47
|
position: 'fixed',
|
|
@@ -31,7 +31,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
31
31
|
// TODO handle responsive
|
|
32
32
|
var layoutColumnStyles = function layoutColumnStyles() {
|
|
33
33
|
return (0, _experiments.editorExperiment)('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
34
|
-
(0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN / 2, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), "var(--ds-
|
|
34
|
+
(0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN / 2, _editorSharedStyles.gridMediumMaxWidth, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), "var(--ds-radius-small, 3px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
35
35
|
(0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: ", "px;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), _styles.LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth);
|
|
36
36
|
};
|
|
37
37
|
var layoutSectionStyles = function layoutSectionStyles() {
|
|
@@ -41,7 +41,7 @@ var codeBidiWarningStyles = exports.codeBidiWarningStyles = (0, _react.css)({
|
|
|
41
41
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
42
42
|
overflowWrap: 'break-word',
|
|
43
43
|
cursor: 'default',
|
|
44
|
-
borderRadius: "var(--ds-
|
|
44
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
45
45
|
margin: "var(--ds-space-0, 0px)",
|
|
46
46
|
padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
47
47
|
position: 'fixed',
|
|
@@ -58,7 +58,7 @@ var codeBlockStyles = exports.codeBlockStyles = (0, _react.css)({
|
|
|
58
58
|
}), ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
59
59
|
position: 'relative',
|
|
60
60
|
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
61
|
-
borderRadius: "var(--ds-
|
|
61
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
62
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
63
63
|
margin: "".concat(blockNodesVerticalMargin, " 0 0 0"),
|
|
64
64
|
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
@@ -90,7 +90,7 @@ var codeBlockStyles = exports.codeBlockStyles = (0, _react.css)({
|
|
|
90
90
|
position: 'relative',
|
|
91
91
|
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
92
92
|
display: 'flex',
|
|
93
|
-
borderRadius: "var(--ds-
|
|
93
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
94
94
|
width: '100%',
|
|
95
95
|
counterReset: 'line',
|
|
96
96
|
overflowX: 'auto',
|
|
@@ -122,7 +122,7 @@ var codeBlockStyles = exports.codeBlockStyles = (0, _react.css)({
|
|
|
122
122
|
tabSize: 4,
|
|
123
123
|
cursor: 'text',
|
|
124
124
|
color: "var(--ds-text, #172B4D)",
|
|
125
|
-
borderRadius: "var(--ds-
|
|
125
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
126
126
|
margin: "var(--ds-space-100, 8px)",
|
|
127
127
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
128
128
|
fontSize: fontSize14px,
|
|
@@ -16,7 +16,7 @@ var codeMarkStyles = exports.codeMarkStyles = (0, _react.css)({
|
|
|
16
16
|
display: 'inline',
|
|
17
17
|
padding: '2px 0.5ch',
|
|
18
18
|
backgroundColor: "var(--ds--code--bg-color,".concat("var(--ds-background-neutral, #091E420F)", ")"),
|
|
19
|
-
borderRadius: "var(--ds-
|
|
19
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
20
20
|
borderStyle: 'none',
|
|
21
21
|
boxDecorationBreak: 'clone',
|
|
22
22
|
color: "var(--ds-text, #172B4D)",
|
|
@@ -28,7 +28,7 @@ var panelStyles = exports.panelStyles = (0, _react.css)({
|
|
|
28
28
|
},
|
|
29
29
|
// panelSharedStyles()
|
|
30
30
|
// panelSharedStylesWithoutPrefix()
|
|
31
|
-
borderRadius: "var(--ds-
|
|
31
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
32
32
|
margin: "0.75rem 0 0",
|
|
33
33
|
paddingTop: "var(--ds-space-100, 8px)",
|
|
34
34
|
paddingRight: "var(--ds-space-200, 16px)",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isNodeVisible = exports.getNodesVisibleInViewport = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
|
|
9
|
+
* This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
|
|
10
|
+
*/
|
|
11
|
+
var isNodeVisible = exports.isNodeVisible = function isNodeVisible(node) {
|
|
12
|
+
var rect = node.getBoundingClientRect();
|
|
13
|
+
var isVisible = rect.x >= 0 && rect.x < window.innerWidth && rect.y >= 0 && rect.y < window.innerHeight;
|
|
14
|
+
return isVisible;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
|
|
19
|
+
* in the editor DOM and counting the node types that are visible.
|
|
20
|
+
*/
|
|
21
|
+
var getNodesVisibleInViewport = exports.getNodesVisibleInViewport = function getNodesVisibleInViewport(editorDom) {
|
|
22
|
+
var MAX_NODES_TO_COUNT = 200;
|
|
23
|
+
var pmNodesList = editorDom.querySelectorAll('[data-prosemirror-node-name]');
|
|
24
|
+
var nodesTypeCounter = {};
|
|
25
|
+
for (var i = 0; i < Math.min(MAX_NODES_TO_COUNT, pmNodesList.length); i++) {
|
|
26
|
+
var node = pmNodesList[i];
|
|
27
|
+
var type = node.getAttribute('data-prosemirror-node-name');
|
|
28
|
+
|
|
29
|
+
// No valid prosemirrornode type, skip.
|
|
30
|
+
if (!type) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
var isVisible = isNodeVisible(node);
|
|
34
|
+
|
|
35
|
+
// Not a visible node, end counting.
|
|
36
|
+
if (!isVisible) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
nodesTypeCounter[type] = (nodesTypeCounter[type] || 0) + 1;
|
|
40
|
+
}
|
|
41
|
+
return nodesTypeCounter;
|
|
42
|
+
};
|
|
@@ -23,6 +23,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
23
23
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
24
24
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
25
25
|
import { getNodesCount } from '../utils/getNodesCount';
|
|
26
|
+
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
26
27
|
import { isFullPage } from '../utils/is-full-page';
|
|
27
28
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
28
29
|
import measurements from '../utils/performance/measure-enum';
|
|
@@ -441,6 +442,7 @@ export function ReactEditorView(props) {
|
|
|
441
442
|
const nodes = getNodesCount(viewRef.current.state.doc);
|
|
442
443
|
const ttfb = getResponseEndTime();
|
|
443
444
|
const contextIdentifier = (_pluginInjectionAPI$c4 = pluginInjectionAPI.current.api().base) === null || _pluginInjectionAPI$c4 === void 0 ? void 0 : _pluginInjectionAPI$c4.sharedState.currentState();
|
|
445
|
+
const nodesInViewport = expValEquals('platform_editor_ttvc_nodes_in_viewport', 'isEnabled', true) ? getNodesVisibleInViewport(viewRef.current.dom) : {};
|
|
444
446
|
dispatchAnalyticsEvent({
|
|
445
447
|
action: ACTION.PROSEMIRROR_RENDERED,
|
|
446
448
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -448,6 +450,7 @@ export function ReactEditorView(props) {
|
|
|
448
450
|
duration,
|
|
449
451
|
startTime,
|
|
450
452
|
nodes,
|
|
453
|
+
nodesInViewport,
|
|
451
454
|
ttfb,
|
|
452
455
|
severity: proseMirrorRenderedSeverity,
|
|
453
456
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -6,7 +6,7 @@ export const dropdown = css({
|
|
|
6
6
|
flexDirection: 'column',
|
|
7
7
|
background: "var(--ds-surface-overlay, white)",
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
9
|
-
borderRadius: "var(--ds-
|
|
9
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
10
10
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)",
|
|
11
11
|
boxSizing: 'border-box',
|
|
12
12
|
padding: `${"var(--ds-space-050, 4px)"} 0`
|
|
@@ -47,7 +47,7 @@ const commentEditorStyles = css({
|
|
|
47
47
|
border: `1px solid ${"var(--ds-border-input, #8590A2)"}`,
|
|
48
48
|
boxSizing: 'border-box',
|
|
49
49
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
50
|
-
borderRadius: "var(--ds-
|
|
50
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
51
51
|
maxWidth: 'inherit',
|
|
52
52
|
wordWrap: 'break-word'
|
|
53
53
|
});
|
|
@@ -9,7 +9,7 @@ export const inputStyle = css({
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
10
10
|
border: `1px solid ${`var(--ds-border-input, ${akEditorSubtleAccent})`}`,
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
12
|
-
borderRadius: "var(--ds-
|
|
12
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
13
13
|
boxSizing: 'border-box',
|
|
14
14
|
height: '40px',
|
|
15
15
|
paddingLeft: "var(--ds-space-250, 20px)",
|
|
@@ -34,7 +34,7 @@ export const codeBidiWarningStyles = css({
|
|
|
34
34
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
35
35
|
overflowWrap: 'break-word',
|
|
36
36
|
cursor: 'default',
|
|
37
|
-
borderRadius: "var(--ds-
|
|
37
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
38
38
|
margin: "var(--ds-space-0, 0px)",
|
|
39
39
|
padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-075, 6px)"}`,
|
|
40
40
|
position: 'fixed',
|
|
@@ -34,7 +34,7 @@ export const codeBidiWarningStyles = css({
|
|
|
34
34
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
35
35
|
overflowWrap: 'break-word',
|
|
36
36
|
cursor: 'default',
|
|
37
|
-
borderRadius: "var(--ds-
|
|
37
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
38
38
|
margin: "var(--ds-space-0, 0px)",
|
|
39
39
|
padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-075, 6px)"}`,
|
|
40
40
|
position: 'fixed',
|
|
@@ -55,7 +55,7 @@ export const codeBlockStyles = css({
|
|
|
55
55
|
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}`]: {
|
|
56
56
|
position: 'relative',
|
|
57
57
|
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
58
|
-
borderRadius: "var(--ds-
|
|
58
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
59
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
60
60
|
margin: `${blockNodesVerticalMargin} 0 0 0`,
|
|
61
61
|
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
@@ -92,7 +92,7 @@ export const codeBlockStyles = css({
|
|
|
92
92
|
position: 'relative',
|
|
93
93
|
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
94
94
|
display: 'flex',
|
|
95
|
-
borderRadius: "var(--ds-
|
|
95
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
96
96
|
width: '100%',
|
|
97
97
|
counterReset: 'line',
|
|
98
98
|
overflowX: 'auto',
|
|
@@ -149,7 +149,7 @@ export const codeBlockStyles = css({
|
|
|
149
149
|
tabSize: 4,
|
|
150
150
|
cursor: 'text',
|
|
151
151
|
color: "var(--ds-text, #172B4D)",
|
|
152
|
-
borderRadius: "var(--ds-
|
|
152
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
153
153
|
margin: "var(--ds-space-100, 8px)",
|
|
154
154
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
155
155
|
fontSize: fontSize14px,
|
|
@@ -9,7 +9,7 @@ export const codeMarkStyles = css({
|
|
|
9
9
|
display: 'inline',
|
|
10
10
|
padding: '2px 0.5ch',
|
|
11
11
|
backgroundColor: `var(--ds--code--bg-color,${"var(--ds-background-neutral, #091E420F)"})`,
|
|
12
|
-
borderRadius: "var(--ds-
|
|
12
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
13
13
|
borderStyle: 'none',
|
|
14
14
|
boxDecorationBreak: 'clone',
|
|
15
15
|
color: "var(--ds-text, #172B4D)",
|
|
@@ -21,7 +21,7 @@ export const panelStyles = css({
|
|
|
21
21
|
},
|
|
22
22
|
// panelSharedStyles()
|
|
23
23
|
// panelSharedStylesWithoutPrefix()
|
|
24
|
-
borderRadius: "var(--ds-
|
|
24
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
25
25
|
margin: `0.75rem 0 0`,
|
|
26
26
|
paddingTop: "var(--ds-space-100, 8px)",
|
|
27
27
|
paddingRight: "var(--ds-space-200, 16px)",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
|
|
3
|
+
* This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
|
|
4
|
+
*/
|
|
5
|
+
export const isNodeVisible = node => {
|
|
6
|
+
const rect = node.getBoundingClientRect();
|
|
7
|
+
const isVisible = rect.x >= 0 && rect.x < window.innerWidth && rect.y >= 0 && rect.y < window.innerHeight;
|
|
8
|
+
return isVisible;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
|
|
13
|
+
* in the editor DOM and counting the node types that are visible.
|
|
14
|
+
*/
|
|
15
|
+
export const getNodesVisibleInViewport = editorDom => {
|
|
16
|
+
const MAX_NODES_TO_COUNT = 200;
|
|
17
|
+
const pmNodesList = editorDom.querySelectorAll('[data-prosemirror-node-name]');
|
|
18
|
+
const nodesTypeCounter = {};
|
|
19
|
+
for (let i = 0; i < Math.min(MAX_NODES_TO_COUNT, pmNodesList.length); i++) {
|
|
20
|
+
const node = pmNodesList[i];
|
|
21
|
+
const type = node.getAttribute('data-prosemirror-node-name');
|
|
22
|
+
|
|
23
|
+
// No valid prosemirrornode type, skip.
|
|
24
|
+
if (!type) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const isVisible = isNodeVisible(node);
|
|
28
|
+
|
|
29
|
+
// Not a visible node, end counting.
|
|
30
|
+
if (!isVisible) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
nodesTypeCounter[type] = (nodesTypeCounter[type] || 0) + 1;
|
|
34
|
+
}
|
|
35
|
+
return nodesTypeCounter;
|
|
36
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "
|
|
2
|
+
export const version = "211.2.1";
|
|
@@ -31,6 +31,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
31
31
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
32
32
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
33
33
|
import { getNodesCount } from '../utils/getNodesCount';
|
|
34
|
+
import { getNodesVisibleInViewport } from '../utils/getNodesVisibleInViewport';
|
|
34
35
|
import { isFullPage } from '../utils/is-full-page';
|
|
35
36
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
36
37
|
import measurements from '../utils/performance/measure-enum';
|
|
@@ -465,6 +466,7 @@ export function ReactEditorView(props) {
|
|
|
465
466
|
var nodes = getNodesCount(viewRef.current.state.doc);
|
|
466
467
|
var ttfb = getResponseEndTime();
|
|
467
468
|
var contextIdentifier = (_pluginInjectionAPI$c2 = pluginInjectionAPI.current.api().base) === null || _pluginInjectionAPI$c2 === void 0 ? void 0 : _pluginInjectionAPI$c2.sharedState.currentState();
|
|
469
|
+
var nodesInViewport = expValEquals('platform_editor_ttvc_nodes_in_viewport', 'isEnabled', true) ? getNodesVisibleInViewport(viewRef.current.dom) : {};
|
|
468
470
|
dispatchAnalyticsEvent({
|
|
469
471
|
action: ACTION.PROSEMIRROR_RENDERED,
|
|
470
472
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -472,6 +474,7 @@ export function ReactEditorView(props) {
|
|
|
472
474
|
duration: duration,
|
|
473
475
|
startTime: startTime,
|
|
474
476
|
nodes: nodes,
|
|
477
|
+
nodesInViewport: nodesInViewport,
|
|
475
478
|
ttfb: ttfb,
|
|
476
479
|
severity: proseMirrorRenderedSeverity,
|
|
477
480
|
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
@@ -6,7 +6,7 @@ export var dropdown = css({
|
|
|
6
6
|
flexDirection: 'column',
|
|
7
7
|
background: "var(--ds-surface-overlay, white)",
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
9
|
-
borderRadius: "var(--ds-
|
|
9
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
10
10
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)",
|
|
11
11
|
boxSizing: 'border-box',
|
|
12
12
|
padding: "var(--ds-space-050, 4px)".concat(" 0")
|
|
@@ -51,7 +51,7 @@ var commentEditorStyles = css({
|
|
|
51
51
|
border: "1px solid ".concat("var(--ds-border-input, #8590A2)"),
|
|
52
52
|
boxSizing: 'border-box',
|
|
53
53
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
54
|
-
borderRadius: "var(--ds-
|
|
54
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
55
55
|
maxWidth: 'inherit',
|
|
56
56
|
wordWrap: 'break-word'
|
|
57
57
|
});
|
|
@@ -9,7 +9,7 @@ export var inputStyle = css({
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
10
10
|
border: "1px solid ".concat("var(--ds-border-input, ".concat(akEditorSubtleAccent, ")")),
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
12
|
-
borderRadius: "var(--ds-
|
|
12
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
13
13
|
boxSizing: 'border-box',
|
|
14
14
|
height: '40px',
|
|
15
15
|
paddingLeft: "var(--ds-space-250, 20px)",
|
|
@@ -34,7 +34,7 @@ export var codeBidiWarningStyles = css({
|
|
|
34
34
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
35
35
|
overflowWrap: 'break-word',
|
|
36
36
|
cursor: 'default',
|
|
37
|
-
borderRadius: "var(--ds-
|
|
37
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
38
38
|
margin: "var(--ds-space-0, 0px)",
|
|
39
39
|
padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
40
40
|
position: 'fixed',
|
|
@@ -25,7 +25,7 @@ var firstNodeWithNotMarginTop = function firstNodeWithNotMarginTop() {
|
|
|
25
25
|
// TODO handle responsive
|
|
26
26
|
var layoutColumnStyles = function layoutColumnStyles() {
|
|
27
27
|
return editorExperiment('advanced_layouts', true) ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
28
|
-
css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN / 2, gridMediumMaxWidth, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket]), "var(--ds-
|
|
28
|
+
css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t\t> [data-layout-column] {\n\t\t\t\t\tmargin: 0 ", "px;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:first-of-type {\n\t\t\t\t\tmargin-left: 0;\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column]:last-of-type {\n\t\t\t\t\tmargin-right: 0;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t> [data-layout-column].", ":not(.danger) {\n\t\t\t\t\t", ";\n\t\t\t\t\t/* layout column selection shorter after layout border has been removed */\n\t\t\t\t\t::before {\n\t\t\t\t\t\twidth: calc(100% - 8px);\n\t\t\t\t\t\tleft: 4px;\n\t\t\t\t\t\tborder-radius: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN / 2, gridMediumMaxWidth, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket]), "var(--ds-radius-small, 3px)") : // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
29
29
|
css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\tmargin-left: ", "px;\n\t\t\t\t}\n\n\t\t\t\t@media screen and (max-width: ", "px) {\n\t\t\t\t\t[data-layout-column] + [data-layout-column] {\n\t\t\t\t\t\tmargin-left: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"])), LAYOUT_SECTION_MARGIN, gridMediumMaxWidth);
|
|
30
30
|
};
|
|
31
31
|
var layoutSectionStyles = function layoutSectionStyles() {
|
|
@@ -34,7 +34,7 @@ export var codeBidiWarningStyles = css({
|
|
|
34
34
|
color: "var(--ds-text-inverse, #FFFFFF)",
|
|
35
35
|
overflowWrap: 'break-word',
|
|
36
36
|
cursor: 'default',
|
|
37
|
-
borderRadius: "var(--ds-
|
|
37
|
+
borderRadius: "var(--ds-radius-small, 4px)",
|
|
38
38
|
margin: "var(--ds-space-0, 0px)",
|
|
39
39
|
padding: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)"),
|
|
40
40
|
position: 'fixed',
|
|
@@ -50,7 +50,7 @@ export var codeBlockStyles = css({
|
|
|
50
50
|
}), ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
51
51
|
position: 'relative',
|
|
52
52
|
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
53
|
-
borderRadius: "var(--ds-
|
|
53
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
54
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
55
55
|
margin: "".concat(blockNodesVerticalMargin, " 0 0 0"),
|
|
56
56
|
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
@@ -82,7 +82,7 @@ export var codeBlockStyles = css({
|
|
|
82
82
|
position: 'relative',
|
|
83
83
|
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
84
84
|
display: 'flex',
|
|
85
|
-
borderRadius: "var(--ds-
|
|
85
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
86
86
|
width: '100%',
|
|
87
87
|
counterReset: 'line',
|
|
88
88
|
overflowX: 'auto',
|
|
@@ -114,7 +114,7 @@ export var codeBlockStyles = css({
|
|
|
114
114
|
tabSize: 4,
|
|
115
115
|
cursor: 'text',
|
|
116
116
|
color: "var(--ds-text, #172B4D)",
|
|
117
|
-
borderRadius: "var(--ds-
|
|
117
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
118
118
|
margin: "var(--ds-space-100, 8px)",
|
|
119
119
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
120
120
|
fontSize: fontSize14px,
|
|
@@ -9,7 +9,7 @@ export var codeMarkStyles = css({
|
|
|
9
9
|
display: 'inline',
|
|
10
10
|
padding: '2px 0.5ch',
|
|
11
11
|
backgroundColor: "var(--ds--code--bg-color,".concat("var(--ds-background-neutral, #091E420F)", ")"),
|
|
12
|
-
borderRadius: "var(--ds-
|
|
12
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
13
13
|
borderStyle: 'none',
|
|
14
14
|
boxDecorationBreak: 'clone',
|
|
15
15
|
color: "var(--ds-text, #172B4D)",
|
|
@@ -21,7 +21,7 @@ export var panelStyles = css({
|
|
|
21
21
|
},
|
|
22
22
|
// panelSharedStyles()
|
|
23
23
|
// panelSharedStylesWithoutPrefix()
|
|
24
|
-
borderRadius: "var(--ds-
|
|
24
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
25
25
|
margin: "0.75rem 0 0",
|
|
26
26
|
paddingTop: "var(--ds-space-100, 8px)",
|
|
27
27
|
paddingRight: "var(--ds-space-200, 16px)",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
|
|
3
|
+
* This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
|
|
4
|
+
*/
|
|
5
|
+
export var isNodeVisible = function isNodeVisible(node) {
|
|
6
|
+
var rect = node.getBoundingClientRect();
|
|
7
|
+
var isVisible = rect.x >= 0 && rect.x < window.innerWidth && rect.y >= 0 && rect.y < window.innerHeight;
|
|
8
|
+
return isVisible;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
|
|
13
|
+
* in the editor DOM and counting the node types that are visible.
|
|
14
|
+
*/
|
|
15
|
+
export var getNodesVisibleInViewport = function getNodesVisibleInViewport(editorDom) {
|
|
16
|
+
var MAX_NODES_TO_COUNT = 200;
|
|
17
|
+
var pmNodesList = editorDom.querySelectorAll('[data-prosemirror-node-name]');
|
|
18
|
+
var nodesTypeCounter = {};
|
|
19
|
+
for (var i = 0; i < Math.min(MAX_NODES_TO_COUNT, pmNodesList.length); i++) {
|
|
20
|
+
var node = pmNodesList[i];
|
|
21
|
+
var type = node.getAttribute('data-prosemirror-node-name');
|
|
22
|
+
|
|
23
|
+
// No valid prosemirrornode type, skip.
|
|
24
|
+
if (!type) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
var isVisible = isNodeVisible(node);
|
|
28
|
+
|
|
29
|
+
// Not a visible node, end counting.
|
|
30
|
+
if (!isVisible) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
nodesTypeCounter[type] = (nodesTypeCounter[type] || 0) + 1;
|
|
34
|
+
}
|
|
35
|
+
return nodesTypeCounter;
|
|
36
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "
|
|
2
|
+
export var version = "211.2.1";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import { type WithIntlProps } from 'react-intl-next';
|
|
2
|
+
import type { WrappedComponentProps, WithIntlProps } from 'react-intl-next';
|
|
4
3
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
5
4
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
|
|
3
|
+
* This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isNodeVisible: (node: Element) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
|
|
8
|
+
* in the editor DOM and counting the node types that are visible.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNodesVisibleInViewport: (editorDom: Element) => Record<string, number>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import { type WithIntlProps } from 'react-intl-next';
|
|
2
|
+
import type { WrappedComponentProps, WithIntlProps } from 'react-intl-next';
|
|
4
3
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
5
4
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
5
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a DOM element is visible within the viewport. We deem a node visible if the top left corner coordinate is within the viewport.
|
|
3
|
+
* This may not look visible, and may include a node that looks below the fold – but it's more than 0 pixels within the viewport.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isNodeVisible: (node: Element) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Get visible nodes in viewport by looping through the first N nodes (MAX_NODES_TO_COUNT)
|
|
8
|
+
* in the editor DOM and counting the node types that are visible.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getNodesVisibleInViewport: (editorDom: Element) => Record<string, number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "211.2.
|
|
3
|
+
"version": "211.2.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
64
64
|
"@atlaskit/react-ufo": "^4.5.0",
|
|
65
65
|
"@atlaskit/task-decision": "^19.2.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
66
|
+
"@atlaskit/tmp-editor-statsig": "^12.4.0",
|
|
67
67
|
"@atlaskit/tokens": "^6.1.0",
|
|
68
68
|
"@atlaskit/tooltip": "^20.4.0",
|
|
69
69
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"uuid": "^3.1.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@atlaskit/editor-common": "^108.
|
|
83
|
+
"@atlaskit/editor-common": "^108.2.0",
|
|
84
84
|
"@atlaskit/link-provider": "^3.7.0",
|
|
85
85
|
"@atlaskit/media-core": "^37.0.0",
|
|
86
86
|
"react": "^18.2.0",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
105
105
|
"@atlaskit/modal-dialog": "^14.3.0",
|
|
106
106
|
"@atlaskit/primitives": "^14.12.0",
|
|
107
|
-
"@atlaskit/renderer": "^121.
|
|
107
|
+
"@atlaskit/renderer": "^121.1.0",
|
|
108
108
|
"@atlaskit/section-message": "^8.7.0",
|
|
109
|
-
"@atlaskit/smart-card": "^40.
|
|
109
|
+
"@atlaskit/smart-card": "^40.18.0",
|
|
110
110
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
111
111
|
"@atlaskit/toggle": "^15.1.0",
|
|
112
112
|
"@atlaskit/util-data-test": "^18.1.0",
|
|
@@ -520,6 +520,15 @@
|
|
|
520
520
|
"platform_editor_adf_with_localid": {
|
|
521
521
|
"type": "boolean",
|
|
522
522
|
"referenceOnly": true
|
|
523
|
+
},
|
|
524
|
+
"platform_editor_resolve_hyperlinks_CONFLUENCE": {
|
|
525
|
+
"type": "boolean"
|
|
526
|
+
},
|
|
527
|
+
"platform_editor_resolve_hyperlinks_JIRA": {
|
|
528
|
+
"type": "boolean"
|
|
529
|
+
},
|
|
530
|
+
"platform_editor_resolve_hyperlinks_killswitch": {
|
|
531
|
+
"type": "boolean"
|
|
523
532
|
}
|
|
524
533
|
},
|
|
525
534
|
"stricter": {
|