@atlaskit/renderer 127.1.0 → 127.2.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 +22 -0
- package/dist/cjs/react/index.js +1 -1
- package/dist/cjs/react/nodes/extension.js +4 -4
- package/dist/cjs/react/nodes/table.js +1 -20
- package/dist/cjs/ui/Expand.js +1 -1
- package/dist/cjs/ui/MediaCard.js +3 -2
- package/dist/cjs/ui/Renderer/index.js +24 -25
- package/dist/es2019/react/index.js +1 -1
- package/dist/es2019/react/nodes/extension.js +4 -4
- package/dist/es2019/react/nodes/table.js +1 -20
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/MediaCard.js +4 -3
- package/dist/es2019/ui/Renderer/index.js +24 -25
- package/dist/esm/react/index.js +1 -1
- package/dist/esm/react/nodes/extension.js +4 -4
- package/dist/esm/react/nodes/table.js +1 -20
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/MediaCard.js +3 -2
- package/dist/esm/ui/Renderer/index.js +24 -25
- package/docs/0-intro.tsx +11 -3
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 127.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`31ee998a097db`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31ee998a097db) -
|
|
8
|
+
Replace expValEquals/expValEqualsNoExposure with editorExperiment for platform_synced_block
|
|
9
|
+
experiment checks
|
|
10
|
+
- [`1d6c1d6ba61dc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1d6c1d6ba61dc) -
|
|
11
|
+
FFCLEANUP-79953 clean up stale experiment platform_editor_editor_width_analytics
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 127.2.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`f444a0d3e2c0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f444a0d3e2c0b) -
|
|
19
|
+
[FFCLEANUP-79468] clean up platform_editor_dec_a11y_fixes feature gate
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 127.1.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -503,7 +503,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
503
503
|
return ((_n$type2 = n.type) === null || _n$type2 === void 0 ? void 0 : _n$type2.name) === 'mediaSingle';
|
|
504
504
|
});
|
|
505
505
|
// Only check path for bodiedSyncBlock; syncBlock uses RendererContext
|
|
506
|
-
var nestedUnder = (0,
|
|
506
|
+
var nestedUnder = (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? (0, _rendererNode.getNestedUnderNodes)(path, ['bodiedSyncBlock']) : undefined;
|
|
507
507
|
var isAnnotationMark = function isAnnotationMark(mark) {
|
|
508
508
|
return mark.type === annotation;
|
|
509
509
|
};
|
|
@@ -95,7 +95,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
95
95
|
"data-testid": "extension--wrapper",
|
|
96
96
|
"data-node-type": "extension"
|
|
97
97
|
}, (0, _react.jsx)("div", {
|
|
98
|
-
tabIndex:
|
|
98
|
+
tabIndex: options.tabIndex
|
|
99
99
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
100
100
|
,
|
|
101
101
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
@@ -124,7 +124,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
124
124
|
"data-layout": layout,
|
|
125
125
|
"data-local-id": localId
|
|
126
126
|
}, (0, _react.jsx)("div", {
|
|
127
|
-
tabIndex:
|
|
127
|
+
tabIndex: options.tabIndex
|
|
128
128
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
129
129
|
,
|
|
130
130
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
@@ -163,7 +163,7 @@ var Extension = function Extension(props) {
|
|
|
163
163
|
isTopLevel: path.length < 1,
|
|
164
164
|
handleRef: handleRef,
|
|
165
165
|
shadowClassNames: shadowClassNames,
|
|
166
|
-
tabIndex:
|
|
166
|
+
tabIndex: props.tabIndex,
|
|
167
167
|
rendererAppearance: props.rendererAppearance
|
|
168
168
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
169
169
|
}
|
|
@@ -177,7 +177,7 @@ var Extension = function Extension(props) {
|
|
|
177
177
|
isTopLevel: path.length < 1,
|
|
178
178
|
handleRef: handleRef,
|
|
179
179
|
shadowClassNames: shadowClassNames,
|
|
180
|
-
tabIndex:
|
|
180
|
+
tabIndex: props.tabIndex,
|
|
181
181
|
rendererAppearance: props.rendererAppearance
|
|
182
182
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
183
183
|
});
|
|
@@ -564,7 +564,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
564
564
|
rendererAppearance: rendererAppearance,
|
|
565
565
|
allowTableResizing: allowTableResizing,
|
|
566
566
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
567
|
-
}, [children && children[0]]),
|
|
567
|
+
}, [children && children[0]]), /*#__PURE__*/_react.default.createElement(TableWrapper, {
|
|
568
568
|
wrapperRef: this.wrapperRef,
|
|
569
569
|
onScroll: this.props.stickyHeaders ? this.onWrapperScrolled : undefined,
|
|
570
570
|
stickyHeaders: stickyHeaders,
|
|
@@ -583,25 +583,6 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
583
583
|
allowTableResizing: allowTableResizing,
|
|
584
584
|
isPresentational: isPresentational,
|
|
585
585
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
586
|
-
}, this.grabFirstRowRef(children))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
587
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
588
|
-
className: _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
589
|
-
ref: this.wrapperRef,
|
|
590
|
-
onScroll: this.props.stickyHeaders && this.onWrapperScrolled
|
|
591
|
-
}, /*#__PURE__*/_react.default.createElement(_table.Table, {
|
|
592
|
-
innerRef: this.tableRef,
|
|
593
|
-
columnWidths: columnWidths,
|
|
594
|
-
layout: layout,
|
|
595
|
-
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
596
|
-
renderWidth: renderWidth,
|
|
597
|
-
tableNode: tableNode,
|
|
598
|
-
rendererAppearance: rendererAppearance,
|
|
599
|
-
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
600
|
-
isInsideOfTable: isInsideOfTable,
|
|
601
|
-
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
602
|
-
allowTableResizing: allowTableResizing,
|
|
603
|
-
isPresentational: isPresentational,
|
|
604
|
-
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
605
586
|
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/_react.default.createElement("div", {
|
|
606
587
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
607
588
|
className: _styles.TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
package/dist/cjs/ui/Expand.js
CHANGED
|
@@ -296,7 +296,7 @@ function Expand(_ref2) {
|
|
|
296
296
|
}, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
|
|
297
297
|
css: clearNextSiblingMarginTopStyle
|
|
298
298
|
}), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? (0, _react.jsx)(_react2.Suspense, {
|
|
299
|
-
fallback: (0, _react.jsx)("div", null,
|
|
299
|
+
fallback: (0, _react.jsx)("div", null, intl.formatMessage(_ui.expandMessages.loading))
|
|
300
300
|
}, (0, _react.jsx)(LazyChildren, null, children)) : null : children))));
|
|
301
301
|
}
|
|
302
302
|
var _default2 = exports.default = (0, _reactIntlNext.injectIntl)(Expand);
|
package/dist/cjs/ui/MediaCard.js
CHANGED
|
@@ -21,6 +21,7 @@ var _mediaCard = require("@atlaskit/media-card");
|
|
|
21
21
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
22
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
23
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
24
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
24
25
|
var _analyticsContext = _interopRequireDefault(require("../analytics/analyticsContext"));
|
|
25
26
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
26
27
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -121,9 +122,9 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
121
122
|
attributes: _objectSpread(_objectSpread({
|
|
122
123
|
reason: reason,
|
|
123
124
|
external: false
|
|
124
|
-
}, nestedUnder && (0,
|
|
125
|
+
}, nestedUnder && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? {
|
|
125
126
|
nestedUnder: nestedUnder
|
|
126
|
-
} : {}), rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType && (0,
|
|
127
|
+
} : {}), rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType && (0, _experiments.editorExperiment)('platform_synced_block', true) && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? {
|
|
127
128
|
nestedRendererType: rendererContext.nestedRendererType
|
|
128
129
|
} : {})
|
|
129
130
|
});
|
|
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
71
71
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
72
72
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
73
73
|
var packageName = "@atlaskit/renderer";
|
|
74
|
-
var packageVersion = "
|
|
74
|
+
var packageVersion = "127.2.0";
|
|
75
75
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
76
76
|
containerName: 'ak-renderer-wrapper',
|
|
77
77
|
containerType: 'inline-size'
|
|
@@ -382,33 +382,32 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
382
382
|
});
|
|
383
383
|
anchorLinkAnalytics();
|
|
384
384
|
});
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
385
|
+
|
|
386
|
+
// send statistics about the heights/widths of the tables on the page for alerting
|
|
387
|
+
heightWidthAnalyticsSetTimeoutID = setTimeout(function () {
|
|
388
|
+
var requestIdleCallbackFn = function requestIdleCallbackFn() {
|
|
389
|
+
var _props$innerRef;
|
|
390
|
+
var renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 || (_props$innerRef = _props$innerRef.current) === null || _props$innerRef === void 0 ? void 0 : _props$innerRef.querySelector('.ak-renderer-document');
|
|
391
|
+
if (renderer) {
|
|
392
|
+
var payload = (0, _analyticsUtils.getWidthInfoPayload)(renderer);
|
|
393
|
+
if (payload) {
|
|
394
|
+
_fireAnalyticsEvent(payload);
|
|
395
|
+
}
|
|
396
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_table_height_analytics_event')) {
|
|
397
|
+
var payloadHeight = (0, _analyticsUtils.getHeightInfoPayload)(renderer);
|
|
398
|
+
if (payloadHeight) {
|
|
399
|
+
_fireAnalyticsEvent(payloadHeight);
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
|
-
};
|
|
404
|
-
if (window && typeof window.requestIdleCallback === 'function') {
|
|
405
|
-
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
406
|
-
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
407
|
-
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
408
|
-
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
409
402
|
}
|
|
410
|
-
}
|
|
411
|
-
|
|
403
|
+
};
|
|
404
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
405
|
+
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
406
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
407
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
408
|
+
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
409
|
+
}
|
|
410
|
+
}, TABLE_INFO_TIMEOUT);
|
|
412
411
|
};
|
|
413
412
|
handleAnalytics();
|
|
414
413
|
return function () {
|
|
@@ -462,7 +462,7 @@ export default class ReactSerializer {
|
|
|
462
462
|
return ((_n$type2 = n.type) === null || _n$type2 === void 0 ? void 0 : _n$type2.name) === 'mediaSingle';
|
|
463
463
|
});
|
|
464
464
|
// Only check path for bodiedSyncBlock; syncBlock uses RendererContext
|
|
465
|
-
const nestedUnder =
|
|
465
|
+
const nestedUnder = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? getNestedUnderNodes(path, ['bodiedSyncBlock']) : undefined;
|
|
466
466
|
const isAnnotationMark = mark => mark.type === annotation;
|
|
467
467
|
const isLinkMark = mark => mark.type === link;
|
|
468
468
|
const isBorderMark = mark => isChildOfMediaSingle && mark.type === border;
|
|
@@ -76,7 +76,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
76
76
|
"data-testid": "extension--wrapper",
|
|
77
77
|
"data-node-type": "extension"
|
|
78
78
|
}, jsx("div", {
|
|
79
|
-
tabIndex:
|
|
79
|
+
tabIndex: options.tabIndex
|
|
80
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
81
81
|
,
|
|
82
82
|
className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
|
|
@@ -106,7 +106,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
106
106
|
"data-layout": layout,
|
|
107
107
|
"data-local-id": localId
|
|
108
108
|
}, jsx("div", {
|
|
109
|
-
tabIndex:
|
|
109
|
+
tabIndex: options.tabIndex
|
|
110
110
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
111
111
|
,
|
|
112
112
|
className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
|
|
@@ -146,7 +146,7 @@ const Extension = props => {
|
|
|
146
146
|
isTopLevel: path.length < 1,
|
|
147
147
|
handleRef,
|
|
148
148
|
shadowClassNames,
|
|
149
|
-
tabIndex:
|
|
149
|
+
tabIndex: props.tabIndex,
|
|
150
150
|
rendererAppearance: props.rendererAppearance
|
|
151
151
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
152
152
|
}
|
|
@@ -160,7 +160,7 @@ const Extension = props => {
|
|
|
160
160
|
isTopLevel: path.length < 1,
|
|
161
161
|
handleRef,
|
|
162
162
|
shadowClassNames,
|
|
163
|
-
tabIndex:
|
|
163
|
+
tabIndex: props.tabIndex,
|
|
164
164
|
rendererAppearance: props.rendererAppearance
|
|
165
165
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
166
166
|
});
|
|
@@ -507,7 +507,7 @@ export class TableContainer extends React.Component {
|
|
|
507
507
|
rendererAppearance: rendererAppearance,
|
|
508
508
|
allowTableResizing: allowTableResizing,
|
|
509
509
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
510
|
-
}, [children && children[0]]),
|
|
510
|
+
}, [children && children[0]]), /*#__PURE__*/React.createElement(TableWrapper, {
|
|
511
511
|
wrapperRef: this.wrapperRef,
|
|
512
512
|
onScroll: this.props.stickyHeaders ? this.onWrapperScrolled : undefined,
|
|
513
513
|
stickyHeaders: stickyHeaders,
|
|
@@ -526,25 +526,6 @@ export class TableContainer extends React.Component {
|
|
|
526
526
|
allowTableResizing: allowTableResizing,
|
|
527
527
|
isPresentational: isPresentational,
|
|
528
528
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
529
|
-
}, this.grabFirstRowRef(children))) : /*#__PURE__*/React.createElement("div", {
|
|
530
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
531
|
-
className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
532
|
-
ref: this.wrapperRef,
|
|
533
|
-
onScroll: this.props.stickyHeaders && this.onWrapperScrolled
|
|
534
|
-
}, /*#__PURE__*/React.createElement(Table, {
|
|
535
|
-
innerRef: this.tableRef,
|
|
536
|
-
columnWidths: columnWidths,
|
|
537
|
-
layout: layout,
|
|
538
|
-
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
539
|
-
renderWidth: renderWidth,
|
|
540
|
-
tableNode: tableNode,
|
|
541
|
-
rendererAppearance: rendererAppearance,
|
|
542
|
-
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
543
|
-
isInsideOfTable: isInsideOfTable,
|
|
544
|
-
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
545
|
-
allowTableResizing: allowTableResizing,
|
|
546
|
-
isPresentational: isPresentational,
|
|
547
|
-
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
548
529
|
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
549
530
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
550
531
|
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -276,7 +276,7 @@ function Expand({
|
|
|
276
276
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
277
277
|
css: clearNextSiblingMarginTopStyle
|
|
278
278
|
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? jsx(Suspense, {
|
|
279
|
-
fallback: jsx("div", null,
|
|
279
|
+
fallback: jsx("div", null, intl.formatMessage(expandMessages.loading))
|
|
280
280
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
281
281
|
}
|
|
282
282
|
export default injectIntl(Expand);
|
|
@@ -6,6 +6,7 @@ import { Card as CardAsync, CardSync, CardLoading, CardError } from '@atlaskit/m
|
|
|
6
6
|
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
7
7
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
import AnalyticsContext from '../analytics/analyticsContext';
|
|
10
11
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -59,7 +60,7 @@ export class MediaCardView extends Component {
|
|
|
59
60
|
fileState
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
} catch
|
|
63
|
+
} catch {
|
|
63
64
|
// do not set state on error
|
|
64
65
|
}
|
|
65
66
|
});
|
|
@@ -77,10 +78,10 @@ export class MediaCardView extends Component {
|
|
|
77
78
|
attributes: {
|
|
78
79
|
reason,
|
|
79
80
|
external: false,
|
|
80
|
-
...(nestedUnder &&
|
|
81
|
+
...(nestedUnder && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? {
|
|
81
82
|
nestedUnder
|
|
82
83
|
} : {}),
|
|
83
|
-
...(rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType &&
|
|
84
|
+
...(rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? {
|
|
84
85
|
nestedRendererType: rendererContext.nestedRendererType
|
|
85
86
|
} : {})
|
|
86
87
|
}
|
|
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
57
57
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
58
58
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
59
59
|
const packageName = "@atlaskit/renderer";
|
|
60
|
-
const packageVersion = "
|
|
60
|
+
const packageVersion = "127.2.0";
|
|
61
61
|
const setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size'
|
|
@@ -373,33 +373,32 @@ export const RendererFunctionalComponent = props => {
|
|
|
373
373
|
});
|
|
374
374
|
anchorLinkAnalytics();
|
|
375
375
|
});
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
376
|
+
|
|
377
|
+
// send statistics about the heights/widths of the tables on the page for alerting
|
|
378
|
+
heightWidthAnalyticsSetTimeoutID = setTimeout(() => {
|
|
379
|
+
const requestIdleCallbackFn = () => {
|
|
380
|
+
var _props$innerRef, _props$innerRef$curre;
|
|
381
|
+
const renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 ? void 0 : (_props$innerRef$curre = _props$innerRef.current) === null || _props$innerRef$curre === void 0 ? void 0 : _props$innerRef$curre.querySelector('.ak-renderer-document');
|
|
382
|
+
if (renderer) {
|
|
383
|
+
const payload = getWidthInfoPayload(renderer);
|
|
384
|
+
if (payload) {
|
|
385
|
+
fireAnalyticsEvent(payload);
|
|
386
|
+
}
|
|
387
|
+
if (fg('platform_editor_table_height_analytics_event')) {
|
|
388
|
+
const payloadHeight = getHeightInfoPayload(renderer);
|
|
389
|
+
if (payloadHeight) {
|
|
390
|
+
fireAnalyticsEvent(payloadHeight);
|
|
392
391
|
}
|
|
393
392
|
}
|
|
394
|
-
};
|
|
395
|
-
if (window && typeof window.requestIdleCallback === 'function') {
|
|
396
|
-
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
397
|
-
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
398
|
-
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
399
|
-
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
400
393
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
394
|
+
};
|
|
395
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
396
|
+
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
397
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
398
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
399
|
+
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
400
|
+
}
|
|
401
|
+
}, TABLE_INFO_TIMEOUT);
|
|
403
402
|
};
|
|
404
403
|
handleAnalytics();
|
|
405
404
|
return () => {
|
package/dist/esm/react/index.js
CHANGED
|
@@ -496,7 +496,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
496
496
|
return ((_n$type2 = n.type) === null || _n$type2 === void 0 ? void 0 : _n$type2.name) === 'mediaSingle';
|
|
497
497
|
});
|
|
498
498
|
// Only check path for bodiedSyncBlock; syncBlock uses RendererContext
|
|
499
|
-
var nestedUnder =
|
|
499
|
+
var nestedUnder = editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? getNestedUnderNodes(path, ['bodiedSyncBlock']) : undefined;
|
|
500
500
|
var isAnnotationMark = function isAnnotationMark(mark) {
|
|
501
501
|
return mark.type === annotation;
|
|
502
502
|
};
|
|
@@ -87,7 +87,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
87
87
|
"data-testid": "extension--wrapper",
|
|
88
88
|
"data-node-type": "extension"
|
|
89
89
|
}, jsx("div", {
|
|
90
|
-
tabIndex:
|
|
90
|
+
tabIndex: options.tabIndex
|
|
91
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
92
92
|
,
|
|
93
93
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
@@ -116,7 +116,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
116
116
|
"data-layout": layout,
|
|
117
117
|
"data-local-id": localId
|
|
118
118
|
}, jsx("div", {
|
|
119
|
-
tabIndex:
|
|
119
|
+
tabIndex: options.tabIndex
|
|
120
120
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
121
121
|
,
|
|
122
122
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
@@ -155,7 +155,7 @@ var Extension = function Extension(props) {
|
|
|
155
155
|
isTopLevel: path.length < 1,
|
|
156
156
|
handleRef: handleRef,
|
|
157
157
|
shadowClassNames: shadowClassNames,
|
|
158
|
-
tabIndex:
|
|
158
|
+
tabIndex: props.tabIndex,
|
|
159
159
|
rendererAppearance: props.rendererAppearance
|
|
160
160
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
161
161
|
}
|
|
@@ -169,7 +169,7 @@ var Extension = function Extension(props) {
|
|
|
169
169
|
isTopLevel: path.length < 1,
|
|
170
170
|
handleRef: handleRef,
|
|
171
171
|
shadowClassNames: shadowClassNames,
|
|
172
|
-
tabIndex:
|
|
172
|
+
tabIndex: props.tabIndex,
|
|
173
173
|
rendererAppearance: props.rendererAppearance
|
|
174
174
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
175
175
|
});
|
|
@@ -557,7 +557,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
557
557
|
rendererAppearance: rendererAppearance,
|
|
558
558
|
allowTableResizing: allowTableResizing,
|
|
559
559
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
560
|
-
}, [children && children[0]]),
|
|
560
|
+
}, [children && children[0]]), /*#__PURE__*/React.createElement(TableWrapper, {
|
|
561
561
|
wrapperRef: this.wrapperRef,
|
|
562
562
|
onScroll: this.props.stickyHeaders ? this.onWrapperScrolled : undefined,
|
|
563
563
|
stickyHeaders: stickyHeaders,
|
|
@@ -576,25 +576,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
576
576
|
allowTableResizing: allowTableResizing,
|
|
577
577
|
isPresentational: isPresentational,
|
|
578
578
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
579
|
-
}, this.grabFirstRowRef(children))) : /*#__PURE__*/React.createElement("div", {
|
|
580
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
581
|
-
className: TableSharedCssClassName.TABLE_NODE_WRAPPER,
|
|
582
|
-
ref: this.wrapperRef,
|
|
583
|
-
onScroll: this.props.stickyHeaders && this.onWrapperScrolled
|
|
584
|
-
}, /*#__PURE__*/React.createElement(Table, {
|
|
585
|
-
innerRef: this.tableRef,
|
|
586
|
-
columnWidths: columnWidths,
|
|
587
|
-
layout: layout,
|
|
588
|
-
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
589
|
-
renderWidth: renderWidth,
|
|
590
|
-
tableNode: tableNode,
|
|
591
|
-
rendererAppearance: rendererAppearance,
|
|
592
|
-
isInsideOfBlockNode: isInsideOfBlockNode,
|
|
593
|
-
isInsideOfTable: isInsideOfTable,
|
|
594
|
-
isinsideMultiBodiedExtension: isinsideMultiBodiedExtension,
|
|
595
|
-
allowTableResizing: allowTableResizing,
|
|
596
|
-
isPresentational: isPresentational,
|
|
597
|
-
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
598
579
|
}, this.grabFirstRowRef(children))), isStickyScrollbarEnabled(this.props.rendererAppearance) && /*#__PURE__*/React.createElement("div", {
|
|
599
580
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
600
581
|
className: TableSharedCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -285,7 +285,7 @@ function Expand(_ref2) {
|
|
|
285
285
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
286
286
|
css: clearNextSiblingMarginTopStyle
|
|
287
287
|
}), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren || loadBodyContent ? jsx(Suspense, {
|
|
288
|
-
fallback: jsx("div", null,
|
|
288
|
+
fallback: jsx("div", null, intl.formatMessage(expandMessages.loading))
|
|
289
289
|
}, jsx(LazyChildren, null, children)) : null : children))));
|
|
290
290
|
}
|
|
291
291
|
export default injectIntl(Expand);
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -17,6 +17,7 @@ import { Card as CardAsync, CardSync, CardLoading, CardError } from '@atlaskit/m
|
|
|
17
17
|
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
18
18
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
19
19
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
21
|
import AnalyticsContext from '../analytics/analyticsContext';
|
|
21
22
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
22
23
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -112,9 +113,9 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
112
113
|
attributes: _objectSpread(_objectSpread({
|
|
113
114
|
reason: reason,
|
|
114
115
|
external: false
|
|
115
|
-
}, nestedUnder &&
|
|
116
|
+
}, nestedUnder && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? {
|
|
116
117
|
nestedUnder: nestedUnder
|
|
117
|
-
} : {}), rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType &&
|
|
118
|
+
} : {}), rendererContext !== null && rendererContext !== void 0 && rendererContext.nestedRendererType && editorExperiment('platform_synced_block', true) && fg('platform_synced_block_patch_5') ? {
|
|
118
119
|
nestedRendererType: rendererContext.nestedRendererType
|
|
119
120
|
} : {})
|
|
120
121
|
});
|
|
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
62
62
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
63
63
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
64
64
|
var packageName = "@atlaskit/renderer";
|
|
65
|
-
var packageVersion = "
|
|
65
|
+
var packageVersion = "127.2.0";
|
|
66
66
|
var setAsQueryContainerStyles = css({
|
|
67
67
|
containerName: 'ak-renderer-wrapper',
|
|
68
68
|
containerType: 'inline-size'
|
|
@@ -373,33 +373,32 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
373
373
|
});
|
|
374
374
|
anchorLinkAnalytics();
|
|
375
375
|
});
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
376
|
+
|
|
377
|
+
// send statistics about the heights/widths of the tables on the page for alerting
|
|
378
|
+
heightWidthAnalyticsSetTimeoutID = setTimeout(function () {
|
|
379
|
+
var requestIdleCallbackFn = function requestIdleCallbackFn() {
|
|
380
|
+
var _props$innerRef;
|
|
381
|
+
var renderer = (_props$innerRef = props.innerRef) === null || _props$innerRef === void 0 || (_props$innerRef = _props$innerRef.current) === null || _props$innerRef === void 0 ? void 0 : _props$innerRef.querySelector('.ak-renderer-document');
|
|
382
|
+
if (renderer) {
|
|
383
|
+
var payload = getWidthInfoPayload(renderer);
|
|
384
|
+
if (payload) {
|
|
385
|
+
_fireAnalyticsEvent(payload);
|
|
386
|
+
}
|
|
387
|
+
if (fg('platform_editor_table_height_analytics_event')) {
|
|
388
|
+
var payloadHeight = getHeightInfoPayload(renderer);
|
|
389
|
+
if (payloadHeight) {
|
|
390
|
+
_fireAnalyticsEvent(payloadHeight);
|
|
392
391
|
}
|
|
393
392
|
}
|
|
394
|
-
};
|
|
395
|
-
if (window && typeof window.requestIdleCallback === 'function') {
|
|
396
|
-
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
397
|
-
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
398
|
-
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
399
|
-
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
400
393
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
394
|
+
};
|
|
395
|
+
if (window && typeof window.requestIdleCallback === 'function') {
|
|
396
|
+
heightWidthAnalyticsRicID = window.requestIdleCallback(requestIdleCallbackFn);
|
|
397
|
+
} else if (window && typeof window.requestAnimationFrame === 'function') {
|
|
398
|
+
// requestIdleCallback is not supported in safari, fallback to requestAnimationFrame
|
|
399
|
+
heightWidthAnalyticsRafID = window.requestAnimationFrame(requestIdleCallbackFn);
|
|
400
|
+
}
|
|
401
|
+
}, TABLE_INFO_TIMEOUT);
|
|
403
402
|
};
|
|
404
403
|
handleAnalytics();
|
|
405
404
|
return function () {
|
package/docs/0-intro.tsx
CHANGED
|
@@ -12,8 +12,11 @@ This component provides a renderer for ADF documents.
|
|
|
12
12
|
Use the component in your React app as follows:
|
|
13
13
|
|
|
14
14
|
${code`
|
|
15
|
+
import { createRoot } from 'react-dom/client';
|
|
15
16
|
import { ReactRenderer } from '@atlaskit/renderer';
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
const root = createRoot(container);
|
|
19
|
+
root.render(<ReactRenderer document={DOCUMENT} />);
|
|
17
20
|
`}
|
|
18
21
|
|
|
19
22
|
## Example
|
|
@@ -102,13 +105,15 @@ You will need to use a transformer to convert your own storage format into the A
|
|
|
102
105
|
We have provided helper utility to simplify this process:
|
|
103
106
|
|
|
104
107
|
${code`
|
|
108
|
+
import { createRoot } from 'react-dom/client';
|
|
105
109
|
import { BitbucketTransformer } from '@atlaskit/editor-bitbucket-transformer';
|
|
106
110
|
import { ReactRenderer, ADFEncoder } from '@atlaskit/renderer';
|
|
107
111
|
|
|
108
112
|
const adfEncoder = new ADFEncoder(schema => new BitbucketTransformer(schema));
|
|
109
113
|
const document = adfEncoder.encode(DOCUMENT);
|
|
110
114
|
|
|
111
|
-
|
|
115
|
+
const root = createRoot(container);
|
|
116
|
+
root.render(<ReactRenderer document={document} />);
|
|
112
117
|
`}
|
|
113
118
|
|
|
114
119
|
## Polyfills
|
|
@@ -124,8 +129,11 @@ The props \`truncated\`, \`maxHeight\` and \`fadeOutHeight\` are all optional. \
|
|
|
124
129
|
and \`fadeOutHeight\` will default to 30px unless defined.
|
|
125
130
|
|
|
126
131
|
${code`
|
|
132
|
+
import { createRoot } from 'react-dom/client';
|
|
127
133
|
import { ReactRenderer } from '@atlaskit/renderer';
|
|
128
|
-
|
|
134
|
+
|
|
135
|
+
const root = createRoot(container);
|
|
136
|
+
root.render(<ReactRenderer document={DOCUMENT} truncated={true} maxHeight={70} fadeOutHeight={30} />);
|
|
129
137
|
`}
|
|
130
138
|
|
|
131
139
|
${(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "127.1
|
|
3
|
+
"version": "127.2.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/status": "^3.1.0",
|
|
58
58
|
"@atlaskit/task-decision": "^19.3.0",
|
|
59
59
|
"@atlaskit/theme": "^22.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^35.0.0",
|
|
61
61
|
"@atlaskit/tokens": "^11.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^20.14.0",
|
|
63
63
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -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.30.0",
|
|
75
75
|
"@atlaskit/link-provider": "^4.2.0",
|
|
76
76
|
"@atlaskit/media-core": "^37.0.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"@atlaskit/mention": "^24.5.0",
|
|
91
91
|
"@atlaskit/modal-dialog": "^14.11.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.41.0",
|
|
94
94
|
"@atlaskit/util-data-test": "^18.5.0",
|
|
95
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
95
|
+
"@atlassian/a11y-jest-testing": "^0.10.0",
|
|
96
96
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
97
97
|
"@atlassian/testing-library": "^0.4.0",
|
|
98
98
|
"@testing-library/react": "^16.3.0",
|
|
@@ -226,9 +226,6 @@
|
|
|
226
226
|
"platform_fix_macro_renders_in_layouts": {
|
|
227
227
|
"type": "boolean"
|
|
228
228
|
},
|
|
229
|
-
"platform_editor_dec_a11y_fixes": {
|
|
230
|
-
"type": "boolean"
|
|
231
|
-
},
|
|
232
229
|
"platform_editor_fix_missing_task_id": {
|
|
233
230
|
"type": "boolean"
|
|
234
231
|
},
|