@atlaskit/renderer 125.3.1 → 125.4.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 +21 -0
- package/dist/cjs/react/index.js +24 -4
- package/dist/cjs/react/renderer-node.js +9 -1
- package/dist/cjs/ui/Expand.js +3 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +25 -6
- package/dist/es2019/react/renderer-node.js +2 -0
- package/dist/es2019/ui/Expand.js +3 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +26 -6
- package/dist/esm/react/renderer-node.js +8 -0
- package/dist/esm/ui/Expand.js +3 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/analytics/events.d.ts +2 -2
- package/dist/types/react/renderer-node.d.ts +1 -0
- package/dist/types/ui/Expand.d.ts +1 -0
- package/dist/types-ts4.5/analytics/events.d.ts +2 -2
- package/dist/types-ts4.5/react/renderer-node.d.ts +1 -0
- package/dist/types-ts4.5/ui/Expand.d.ts +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 125.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5852113f7c414`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5852113f7c414) -
|
|
8
|
+
Updates expand content rendering with inline comments to support lazy loading
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`fff45a651440a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fff45a651440a) -
|
|
13
|
+
EDITOR-1665 add experience tracking analytics for sync block save, fetch and delete
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 125.3.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`8a3fc4137f1b4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8a3fc4137f1b4) -
|
|
21
|
+
[ux] [EDITOR-3850] disable sticky headers for tables in expands in the renderer
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 125.3.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -268,6 +268,11 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
268
268
|
return this.getInlineCardProps(node, path);
|
|
269
269
|
case 'expand':
|
|
270
270
|
return this.getExpandProps(node, path);
|
|
271
|
+
case 'nestedExpand':
|
|
272
|
+
if ((0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content')) {
|
|
273
|
+
return this.getExpandProps(node, path);
|
|
274
|
+
}
|
|
275
|
+
return this.getProps(node, path);
|
|
271
276
|
case 'unsupportedBlock':
|
|
272
277
|
case 'unsupportedInline':
|
|
273
278
|
return this.getUnsupportedContentProps(node);
|
|
@@ -428,8 +433,9 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
428
433
|
var isInsideMultiBodiedExtension = (0, _rendererNode.insideMultiBodiedExtension)(path, node.type.schema);
|
|
429
434
|
var isInsideOfTable = (0, _rendererNode.insideTable)(path, node.type.schema);
|
|
430
435
|
|
|
431
|
-
// TODO:
|
|
432
|
-
var
|
|
436
|
+
// TODO: EDITOR-3850 - support sticky headers inside breakouts (layouts and expands)
|
|
437
|
+
var isInsideBreakoutExpand = (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && (0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_patch_11', 'isEnabled', true) && (0, _rendererNode.insideBreakoutExpand)(path);
|
|
438
|
+
var stickyHeaders = !isInsideOfTable && !(0, _rendererNode.insideBreakoutLayout)(path) && !isInsideBreakoutExpand ? this.stickyHeaders : undefined;
|
|
433
439
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
434
440
|
allowColumnSorting: this.allowColumnSorting,
|
|
435
441
|
columnWidths: (0, _utils.getColumnWidths)(node),
|
|
@@ -683,15 +689,29 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
683
689
|
value: function getExpandProps(node) {
|
|
684
690
|
var _this7 = this;
|
|
685
691
|
var _path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
692
|
+
var loadBodyContent = false;
|
|
693
|
+
if ((0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content')) {
|
|
694
|
+
var annotations = (0, _utils2.findChildrenByMark)(node, node.type.schema.marks.annotation, true);
|
|
695
|
+
// Force rendering children if there are inline comments to support comments navigation
|
|
696
|
+
// which relies on the HTML node to be present.
|
|
697
|
+
loadBodyContent = annotations.some(function (annotation) {
|
|
698
|
+
return annotation.node.marks.some(function (mark) {
|
|
699
|
+
return mark.attrs.annotationType === 'inlineComment';
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
}
|
|
686
703
|
if (!(0, _links.isNestedHeaderLinksEnabled)(this.allowHeadingAnchorLinks)) {
|
|
687
|
-
return this.getProps(node)
|
|
704
|
+
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
705
|
+
loadBodyContent: loadBodyContent
|
|
706
|
+
});
|
|
688
707
|
}
|
|
689
708
|
var nestedHeaderIds = (0, _utils2.findChildrenByType)(node, node.type.schema.nodes.heading).map(function (_ref4) {
|
|
690
709
|
var node = _ref4.node;
|
|
691
710
|
return _this7.getHeadingId(node, _this7.expandHeadingIds);
|
|
692
711
|
});
|
|
693
712
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
694
|
-
nestedHeaderIds: nestedHeaderIds
|
|
713
|
+
nestedHeaderIds: nestedHeaderIds,
|
|
714
|
+
loadBodyContent: loadBodyContent
|
|
695
715
|
});
|
|
696
716
|
}
|
|
697
717
|
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.insideTable = exports.insideMultiBodiedExtension = exports.insideBreakoutLayout = exports.insideBlockNode = void 0;
|
|
6
|
+
exports.insideTable = exports.insideMultiBodiedExtension = exports.insideBreakoutLayout = exports.insideBreakoutExpand = exports.insideBlockNode = void 0;
|
|
7
7
|
var isLayoutNode = function isLayoutNode(node) {
|
|
8
8
|
return node.type.name === 'layoutSection';
|
|
9
9
|
};
|
|
10
|
+
var isExpandNode = function isExpandNode(node) {
|
|
11
|
+
return node.type.name === 'expand';
|
|
12
|
+
};
|
|
10
13
|
var hasBreakOutMark = function hasBreakOutMark(node) {
|
|
11
14
|
return node.marks.some(function (m) {
|
|
12
15
|
return m.type.name === 'breakout';
|
|
@@ -17,6 +20,11 @@ var insideBreakoutLayout = exports.insideBreakoutLayout = function insideBreakou
|
|
|
17
20
|
return isLayoutNode(item) && hasBreakOutMark(item);
|
|
18
21
|
});
|
|
19
22
|
};
|
|
23
|
+
var insideBreakoutExpand = exports.insideBreakoutExpand = function insideBreakoutExpand(path) {
|
|
24
|
+
return path.some(function (item) {
|
|
25
|
+
return isExpandNode(item) && hasBreakOutMark(item);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
20
28
|
var insideBlockNode = exports.insideBlockNode = function insideBlockNode(path, schema) {
|
|
21
29
|
var _schema$nodes = schema.nodes,
|
|
22
30
|
expand = _schema$nodes.expand,
|
package/dist/cjs/ui/Expand.js
CHANGED
|
@@ -201,7 +201,8 @@ function Expand(_ref2) {
|
|
|
201
201
|
fireAnalyticsEvent = _ref2.fireAnalyticsEvent,
|
|
202
202
|
localId = _ref2.localId,
|
|
203
203
|
nestedHeaderIds = _ref2.nestedHeaderIds,
|
|
204
|
-
rendererContentMode = _ref2.rendererContentMode
|
|
204
|
+
rendererContentMode = _ref2.rendererContentMode,
|
|
205
|
+
loadBodyContent = _ref2.loadBodyContent;
|
|
205
206
|
var _React$useState = _react2.default.useState(false),
|
|
206
207
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
207
208
|
expanded = _React$useState2[0],
|
|
@@ -291,7 +292,7 @@ function Expand(_ref2) {
|
|
|
291
292
|
className: "".concat(nodeType, "-content-wrapper")
|
|
292
293
|
}, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
|
|
293
294
|
css: clearNextSiblingMarginTopStyle
|
|
294
|
-
}), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? (0, _react.jsx)(_react2.Suspense, {
|
|
295
|
+
}), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? (0, _react.jsx)(_react2.Suspense, {
|
|
295
296
|
fallback: (0, _react.jsx)("div", null, (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? intl.formatMessage(_ui.expandMessages.loading) : 'Loading...')
|
|
296
297
|
}, (0, _react.jsx)(LazyChildren, null, children)) : null : children))));
|
|
297
298
|
}
|
|
@@ -70,7 +70,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
70
70
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
71
71
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
72
72
|
var packageName = "@atlaskit/renderer";
|
|
73
|
-
var packageVersion = "125.3.
|
|
73
|
+
var packageVersion = "125.3.2";
|
|
74
74
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
75
75
|
containerName: 'ak-renderer-wrapper',
|
|
76
76
|
containerType: 'inline-size'
|
|
@@ -9,12 +9,12 @@ import TextWrapperComponent from './nodes/text-wrapper';
|
|
|
9
9
|
import { isNestedHeaderLinksEnabled } from './utils/links';
|
|
10
10
|
import { getColumnWidths } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
|
|
12
|
-
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
12
|
+
import { findChildrenByMark, findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { getText } from '../utils';
|
|
15
15
|
import { isAnnotationMark, toReact as markToReact } from './marks';
|
|
16
16
|
import { isCodeMark } from './marks/code';
|
|
17
|
-
import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension, insideTable } from './renderer-node';
|
|
17
|
+
import { insideBlockNode, insideBreakoutExpand, insideBreakoutLayout, insideMultiBodiedExtension, insideTable } from './renderer-node';
|
|
18
18
|
import { renderTextSegments } from './utils/render-text-segments';
|
|
19
19
|
import { segmentText } from './utils/segment-text';
|
|
20
20
|
import { getStandaloneBackgroundColorMarks } from './utils/getStandaloneBackgroundColorMarks';
|
|
@@ -251,6 +251,11 @@ export default class ReactSerializer {
|
|
|
251
251
|
return this.getInlineCardProps(node, path);
|
|
252
252
|
case 'expand':
|
|
253
253
|
return this.getExpandProps(node, path);
|
|
254
|
+
case 'nestedExpand':
|
|
255
|
+
if (fg('hot-121622_lazy_load_expand_content')) {
|
|
256
|
+
return this.getExpandProps(node, path);
|
|
257
|
+
}
|
|
258
|
+
return this.getProps(node, path);
|
|
254
259
|
case 'unsupportedBlock':
|
|
255
260
|
case 'unsupportedInline':
|
|
256
261
|
return this.getUnsupportedContentProps(node);
|
|
@@ -394,8 +399,9 @@ export default class ReactSerializer {
|
|
|
394
399
|
const isInsideMultiBodiedExtension = insideMultiBodiedExtension(path, node.type.schema);
|
|
395
400
|
const isInsideOfTable = insideTable(path, node.type.schema);
|
|
396
401
|
|
|
397
|
-
// TODO:
|
|
398
|
-
const
|
|
402
|
+
// TODO: EDITOR-3850 - support sticky headers inside breakouts (layouts and expands)
|
|
403
|
+
const isInsideBreakoutExpand = expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && expValEquals('platform_editor_table_sticky_header_patch_11', 'isEnabled', true) && insideBreakoutExpand(path);
|
|
404
|
+
const stickyHeaders = !isInsideOfTable && !insideBreakoutLayout(path) && !isInsideBreakoutExpand ? this.stickyHeaders : undefined;
|
|
399
405
|
return {
|
|
400
406
|
...this.getProps(node),
|
|
401
407
|
allowColumnSorting: this.allowColumnSorting,
|
|
@@ -606,15 +612,28 @@ export default class ReactSerializer {
|
|
|
606
612
|
};
|
|
607
613
|
}
|
|
608
614
|
getExpandProps(node, _path = []) {
|
|
615
|
+
let loadBodyContent = false;
|
|
616
|
+
if (fg('hot-121622_lazy_load_expand_content')) {
|
|
617
|
+
const annotations = findChildrenByMark(node, node.type.schema.marks.annotation, true);
|
|
618
|
+
// Force rendering children if there are inline comments to support comments navigation
|
|
619
|
+
// which relies on the HTML node to be present.
|
|
620
|
+
loadBodyContent = annotations.some(annotation => {
|
|
621
|
+
return annotation.node.marks.some(mark => mark.attrs.annotationType === 'inlineComment');
|
|
622
|
+
});
|
|
623
|
+
}
|
|
609
624
|
if (!isNestedHeaderLinksEnabled(this.allowHeadingAnchorLinks)) {
|
|
610
|
-
return
|
|
625
|
+
return {
|
|
626
|
+
...this.getProps(node),
|
|
627
|
+
loadBodyContent
|
|
628
|
+
};
|
|
611
629
|
}
|
|
612
630
|
const nestedHeaderIds = findChildrenByType(node, node.type.schema.nodes.heading).map(({
|
|
613
631
|
node
|
|
614
632
|
}) => this.getHeadingId(node, this.expandHeadingIds));
|
|
615
633
|
return {
|
|
616
634
|
...this.getProps(node),
|
|
617
|
-
nestedHeaderIds
|
|
635
|
+
nestedHeaderIds,
|
|
636
|
+
loadBodyContent
|
|
618
637
|
};
|
|
619
638
|
}
|
|
620
639
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const isLayoutNode = node => node.type.name === 'layoutSection';
|
|
2
|
+
const isExpandNode = node => node.type.name === 'expand';
|
|
2
3
|
const hasBreakOutMark = node => node.marks.some(m => m.type.name === 'breakout');
|
|
3
4
|
export const insideBreakoutLayout = path => path.some(item => isLayoutNode(item) && hasBreakOutMark(item));
|
|
5
|
+
export const insideBreakoutExpand = path => path.some(item => isExpandNode(item) && hasBreakOutMark(item));
|
|
4
6
|
export const insideBlockNode = (path, schema) => {
|
|
5
7
|
const {
|
|
6
8
|
nodes: {
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -192,7 +192,8 @@ function Expand({
|
|
|
192
192
|
fireAnalyticsEvent,
|
|
193
193
|
localId,
|
|
194
194
|
nestedHeaderIds,
|
|
195
|
-
rendererContentMode
|
|
195
|
+
rendererContentMode,
|
|
196
|
+
loadBodyContent
|
|
196
197
|
}) {
|
|
197
198
|
const [expanded, setExpanded] = React.useState(false);
|
|
198
199
|
const [focused, setFocused] = React.useState(false);
|
|
@@ -271,7 +272,7 @@ function Expand({
|
|
|
271
272
|
className: `${nodeType}-content-wrapper`
|
|
272
273
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
273
274
|
css: clearNextSiblingMarginTopStyle
|
|
274
|
-
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? jsx(Suspense, {
|
|
275
|
+
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? jsx(Suspense, {
|
|
275
276
|
fallback: jsx("div", null, fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(expandMessages.loading) : 'Loading...')
|
|
276
277
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
277
278
|
}
|
|
@@ -56,7 +56,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
56
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
57
57
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
58
58
|
const packageName = "@atlaskit/renderer";
|
|
59
|
-
const packageVersion = "125.3.
|
|
59
|
+
const packageVersion = "125.3.2";
|
|
60
60
|
const setAsQueryContainerStyles = css({
|
|
61
61
|
containerName: 'ak-renderer-wrapper',
|
|
62
62
|
containerType: 'inline-size'
|
package/dist/esm/react/index.js
CHANGED
|
@@ -16,12 +16,12 @@ import TextWrapperComponent from './nodes/text-wrapper';
|
|
|
16
16
|
import { isNestedHeaderLinksEnabled } from './utils/links';
|
|
17
17
|
import { getColumnWidths } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
|
|
19
|
-
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
19
|
+
import { findChildrenByMark, findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
21
|
import { getText } from '../utils';
|
|
22
22
|
import { isAnnotationMark, toReact as markToReact } from './marks';
|
|
23
23
|
import { isCodeMark } from './marks/code';
|
|
24
|
-
import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension, insideTable } from './renderer-node';
|
|
24
|
+
import { insideBlockNode, insideBreakoutExpand, insideBreakoutLayout, insideMultiBodiedExtension, insideTable } from './renderer-node';
|
|
25
25
|
import { renderTextSegments } from './utils/render-text-segments';
|
|
26
26
|
import { segmentText } from './utils/segment-text';
|
|
27
27
|
import { getStandaloneBackgroundColorMarks } from './utils/getStandaloneBackgroundColorMarks';
|
|
@@ -261,6 +261,11 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
261
261
|
return this.getInlineCardProps(node, path);
|
|
262
262
|
case 'expand':
|
|
263
263
|
return this.getExpandProps(node, path);
|
|
264
|
+
case 'nestedExpand':
|
|
265
|
+
if (fg('hot-121622_lazy_load_expand_content')) {
|
|
266
|
+
return this.getExpandProps(node, path);
|
|
267
|
+
}
|
|
268
|
+
return this.getProps(node, path);
|
|
264
269
|
case 'unsupportedBlock':
|
|
265
270
|
case 'unsupportedInline':
|
|
266
271
|
return this.getUnsupportedContentProps(node);
|
|
@@ -421,8 +426,9 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
421
426
|
var isInsideMultiBodiedExtension = insideMultiBodiedExtension(path, node.type.schema);
|
|
422
427
|
var isInsideOfTable = insideTable(path, node.type.schema);
|
|
423
428
|
|
|
424
|
-
// TODO:
|
|
425
|
-
var
|
|
429
|
+
// TODO: EDITOR-3850 - support sticky headers inside breakouts (layouts and expands)
|
|
430
|
+
var isInsideBreakoutExpand = expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && expValEquals('platform_editor_table_sticky_header_patch_11', 'isEnabled', true) && insideBreakoutExpand(path);
|
|
431
|
+
var stickyHeaders = !isInsideOfTable && !insideBreakoutLayout(path) && !isInsideBreakoutExpand ? this.stickyHeaders : undefined;
|
|
426
432
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
427
433
|
allowColumnSorting: this.allowColumnSorting,
|
|
428
434
|
columnWidths: getColumnWidths(node),
|
|
@@ -676,15 +682,29 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
676
682
|
value: function getExpandProps(node) {
|
|
677
683
|
var _this7 = this;
|
|
678
684
|
var _path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
685
|
+
var loadBodyContent = false;
|
|
686
|
+
if (fg('hot-121622_lazy_load_expand_content')) {
|
|
687
|
+
var annotations = findChildrenByMark(node, node.type.schema.marks.annotation, true);
|
|
688
|
+
// Force rendering children if there are inline comments to support comments navigation
|
|
689
|
+
// which relies on the HTML node to be present.
|
|
690
|
+
loadBodyContent = annotations.some(function (annotation) {
|
|
691
|
+
return annotation.node.marks.some(function (mark) {
|
|
692
|
+
return mark.attrs.annotationType === 'inlineComment';
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
}
|
|
679
696
|
if (!isNestedHeaderLinksEnabled(this.allowHeadingAnchorLinks)) {
|
|
680
|
-
return this.getProps(node)
|
|
697
|
+
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
698
|
+
loadBodyContent: loadBodyContent
|
|
699
|
+
});
|
|
681
700
|
}
|
|
682
701
|
var nestedHeaderIds = findChildrenByType(node, node.type.schema.nodes.heading).map(function (_ref4) {
|
|
683
702
|
var node = _ref4.node;
|
|
684
703
|
return _this7.getHeadingId(node, _this7.expandHeadingIds);
|
|
685
704
|
});
|
|
686
705
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
687
|
-
nestedHeaderIds: nestedHeaderIds
|
|
706
|
+
nestedHeaderIds: nestedHeaderIds,
|
|
707
|
+
loadBodyContent: loadBodyContent
|
|
688
708
|
});
|
|
689
709
|
}
|
|
690
710
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
var isLayoutNode = function isLayoutNode(node) {
|
|
2
2
|
return node.type.name === 'layoutSection';
|
|
3
3
|
};
|
|
4
|
+
var isExpandNode = function isExpandNode(node) {
|
|
5
|
+
return node.type.name === 'expand';
|
|
6
|
+
};
|
|
4
7
|
var hasBreakOutMark = function hasBreakOutMark(node) {
|
|
5
8
|
return node.marks.some(function (m) {
|
|
6
9
|
return m.type.name === 'breakout';
|
|
@@ -11,6 +14,11 @@ export var insideBreakoutLayout = function insideBreakoutLayout(path) {
|
|
|
11
14
|
return isLayoutNode(item) && hasBreakOutMark(item);
|
|
12
15
|
});
|
|
13
16
|
};
|
|
17
|
+
export var insideBreakoutExpand = function insideBreakoutExpand(path) {
|
|
18
|
+
return path.some(function (item) {
|
|
19
|
+
return isExpandNode(item) && hasBreakOutMark(item);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
14
22
|
export var insideBlockNode = function insideBlockNode(path, schema) {
|
|
15
23
|
var _schema$nodes = schema.nodes,
|
|
16
24
|
expand = _schema$nodes.expand,
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -192,7 +192,8 @@ function Expand(_ref2) {
|
|
|
192
192
|
fireAnalyticsEvent = _ref2.fireAnalyticsEvent,
|
|
193
193
|
localId = _ref2.localId,
|
|
194
194
|
nestedHeaderIds = _ref2.nestedHeaderIds,
|
|
195
|
-
rendererContentMode = _ref2.rendererContentMode
|
|
195
|
+
rendererContentMode = _ref2.rendererContentMode,
|
|
196
|
+
loadBodyContent = _ref2.loadBodyContent;
|
|
196
197
|
var _React$useState = React.useState(false),
|
|
197
198
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
198
199
|
expanded = _React$useState2[0],
|
|
@@ -282,7 +283,7 @@ function Expand(_ref2) {
|
|
|
282
283
|
className: "".concat(nodeType, "-content-wrapper")
|
|
283
284
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
284
285
|
css: clearNextSiblingMarginTopStyle
|
|
285
|
-
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? jsx(Suspense, {
|
|
286
|
+
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? jsx(Suspense, {
|
|
286
287
|
fallback: jsx("div", null, fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(expandMessages.loading) : 'Loading...')
|
|
287
288
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
288
289
|
}
|
|
@@ -61,7 +61,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
61
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
62
62
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
63
63
|
var packageName = "@atlaskit/renderer";
|
|
64
|
-
var packageVersion = "125.3.
|
|
64
|
+
var packageVersion = "125.3.2";
|
|
65
65
|
var setAsQueryContainerStyles = css({
|
|
66
66
|
containerName: 'ak-renderer-wrapper',
|
|
67
67
|
containerType: 'inline-size'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, ExperienceEventPayload, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { AEP } from './enums';
|
|
3
3
|
import type { SortOrder } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UnsupportedContentPayload, UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/utils';
|
|
@@ -159,6 +159,6 @@ type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJ
|
|
|
159
159
|
type ReferenceSyncedBlockUpdateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE, {
|
|
160
160
|
error: string;
|
|
161
161
|
}>;
|
|
162
|
-
export type AnalyticsEventPayload<_T = void> = RendererStartAEP | RendererRenderedAEP | RendererRenderedSampledAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | HoverLabelAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | TableRendererHeightInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP | MediaRenderErrorEvent | SyncedBlockFetchErrorAEP | SyncedBlockGetSourceInfoErrorAEP | ReferenceSyncedBlockUpdateErrorAEP;
|
|
162
|
+
export type AnalyticsEventPayload<_T = void> = RendererStartAEP | RendererRenderedAEP | RendererRenderedSampledAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | HoverLabelAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | TableRendererHeightInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP | MediaRenderErrorEvent | SyncedBlockFetchErrorAEP | SyncedBlockGetSourceInfoErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
163
163
|
export type FireAnalyticsCallback = <T = void>(payload: AnalyticsEventPayload<T>) => void | undefined;
|
|
164
164
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const insideBreakoutLayout: (path: Node[]) => boolean;
|
|
3
|
+
export declare const insideBreakoutExpand: (path: Node[]) => boolean;
|
|
3
4
|
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
|
4
5
|
export declare const insideMultiBodiedExtension: (path: Node[], schema: Schema) => boolean;
|
|
5
6
|
export declare const insideTable: (path: Node[], schema: Schema) => boolean;
|
|
@@ -5,6 +5,7 @@ import type { RendererAppearance, RendererContentMode } from './Renderer/types';
|
|
|
5
5
|
export interface ExpandProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
8
|
+
loadBodyContent?: boolean;
|
|
8
9
|
localId?: string;
|
|
9
10
|
nestedHeaderIds?: Array<string>;
|
|
10
11
|
nodeType: 'expand' | 'nestedExpand';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, OperationalAEP, ExperienceEventPayload, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { AEP } from './enums';
|
|
3
3
|
import type { SortOrder } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UnsupportedContentPayload, UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/utils';
|
|
@@ -159,6 +159,6 @@ type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJ
|
|
|
159
159
|
type ReferenceSyncedBlockUpdateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE, {
|
|
160
160
|
error: string;
|
|
161
161
|
}>;
|
|
162
|
-
export type AnalyticsEventPayload<_T = void> = RendererStartAEP | RendererRenderedAEP | RendererRenderedSampledAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | HoverLabelAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | TableRendererHeightInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP | MediaRenderErrorEvent | SyncedBlockFetchErrorAEP | SyncedBlockGetSourceInfoErrorAEP | ReferenceSyncedBlockUpdateErrorAEP;
|
|
162
|
+
export type AnalyticsEventPayload<_T = void> = RendererStartAEP | RendererRenderedAEP | RendererRenderedSampledAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | HoverLabelAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | TableRendererHeightInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP | MediaRenderErrorEvent | SyncedBlockFetchErrorAEP | SyncedBlockGetSourceInfoErrorAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
163
163
|
export type FireAnalyticsCallback = <T = void>(payload: AnalyticsEventPayload<T>) => void | undefined;
|
|
164
164
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export declare const insideBreakoutLayout: (path: Node[]) => boolean;
|
|
3
|
+
export declare const insideBreakoutExpand: (path: Node[]) => boolean;
|
|
3
4
|
export declare const insideBlockNode: (path: Node[], schema: Schema) => boolean;
|
|
4
5
|
export declare const insideMultiBodiedExtension: (path: Node[], schema: Schema) => boolean;
|
|
5
6
|
export declare const insideTable: (path: Node[], schema: Schema) => boolean;
|
|
@@ -5,6 +5,7 @@ import type { RendererAppearance, RendererContentMode } from './Renderer/types';
|
|
|
5
5
|
export interface ExpandProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
8
|
+
loadBodyContent?: boolean;
|
|
8
9
|
localId?: string;
|
|
9
10
|
nestedHeaderIds?: Array<string>;
|
|
10
11
|
nodeType: 'expand' | 'nestedExpand';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "125.
|
|
3
|
+
"version": "125.4.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
55
55
|
"@atlaskit/react-ufo": "^4.17.0",
|
|
56
56
|
"@atlaskit/smart-card": "^43.20.0",
|
|
57
|
-
"@atlaskit/status": "^3.
|
|
57
|
+
"@atlaskit/status": "^3.1.0",
|
|
58
58
|
"@atlaskit/task-decision": "^19.2.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^16.19.0",
|
|
61
61
|
"@atlaskit/tokens": "^9.1.0",
|
|
62
|
-
"@atlaskit/tooltip": "^20.
|
|
62
|
+
"@atlaskit/tooltip": "^20.14.0",
|
|
63
63
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|
|
65
65
|
"@emotion/react": "^11.7.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^111.
|
|
74
|
+
"@atlaskit/editor-common": "^111.8.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.1.0",
|
|
76
76
|
"@atlaskit/media-core": "^37.0.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
89
89
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
90
90
|
"@atlaskit/mention": "^24.4.0",
|
|
91
|
-
"@atlaskit/modal-dialog": "^14.
|
|
91
|
+
"@atlaskit/modal-dialog": "^14.10.0",
|
|
92
92
|
"@atlaskit/navigation-next": "patch:@atlaskit/navigation-next@npm%3A9.0.17#~/.yarn/patches/@atlaskit-navigation-next-npm-9.0.17-958ca0ab9d.patch",
|
|
93
|
-
"@atlaskit/profilecard": "^24.
|
|
93
|
+
"@atlaskit/profilecard": "^24.30.0",
|
|
94
94
|
"@atlaskit/util-data-test": "^18.4.0",
|
|
95
95
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
96
96
|
"@testing-library/react": "^16.3.0",
|