@atlaskit/renderer 124.1.7 → 124.2.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 124.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`eed7bfad5be2c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eed7bfad5be2c) -
8
+ Lazy load expand content on opening an expand element
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
3
14
  ## 124.1.7
4
15
 
5
16
  ### Patch Changes
@@ -153,7 +153,7 @@ var TableWrapper = function TableWrapper(_ref2) {
153
153
  ref: wrapperRef,
154
154
  onScroll: stickyHeaders ? onScroll : undefined
155
155
  // Adding tabIndex here because this is a scrollable container and it needs to be focusable so keyboard users can scroll it.
156
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex, @atlassian/a11y/no-noninteractive-tabindex
156
+ // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
157
157
  ,
158
158
  tabIndex: 0,
159
159
  role: "region",
@@ -17,6 +17,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
18
18
  var _chevronRight2 = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
19
19
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
21
22
  var _reactIntlNext = require("react-intl-next");
22
23
  var _events = require("../analytics/events");
@@ -135,6 +136,16 @@ var clearNextSiblingMarginTopStyle = (0, _react.css)({
135
136
  marginTop: '0 !important'
136
137
  }
137
138
  });
139
+
140
+ // Lazy-loaded children component
141
+ var LazyChildren = /*#__PURE__*/(0, _react2.lazy)(function () {
142
+ return Promise.resolve({
143
+ default: function _default(_ref) {
144
+ var children = _ref.children;
145
+ return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, children);
146
+ }
147
+ });
148
+ });
138
149
  var Container = function Container(props) {
139
150
  return (0, _react.jsx)("div", (0, _extends2.default)({
140
151
  css: [containerStyles, props['data-node-type'] === 'expand' && containerStylesDataNodeTypeExpand, props.expanded && containerStylesExpanded, props.focused && containerStylesFocused]
@@ -178,15 +189,15 @@ function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
178
189
  eventType: _analytics.EVENT_TYPE.TRACK
179
190
  });
180
191
  }
181
- function Expand(_ref) {
182
- var title = _ref.title,
183
- children = _ref.children,
184
- nodeType = _ref.nodeType,
185
- intl = _ref.intl,
186
- fireAnalyticsEvent = _ref.fireAnalyticsEvent,
187
- localId = _ref.localId,
188
- nestedHeaderIds = _ref.nestedHeaderIds,
189
- rendererAppearance = _ref.rendererAppearance;
192
+ function Expand(_ref2) {
193
+ var title = _ref2.title,
194
+ children = _ref2.children,
195
+ nodeType = _ref2.nodeType,
196
+ intl = _ref2.intl,
197
+ fireAnalyticsEvent = _ref2.fireAnalyticsEvent,
198
+ localId = _ref2.localId,
199
+ nestedHeaderIds = _ref2.nestedHeaderIds,
200
+ rendererAppearance = _ref2.rendererAppearance;
190
201
  var _React$useState = _react2.default.useState(false),
191
202
  _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
192
203
  expanded = _React$useState2[0],
@@ -264,6 +275,8 @@ function Expand(_ref) {
264
275
  className: "".concat(nodeType, "-content-wrapper")
265
276
  }, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
266
277
  css: clearNextSiblingMarginTopStyle
267
- }), children))));
278
+ }), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? expanded ? (0, _react.jsx)(_react2.Suspense, {
279
+ fallback: (0, _react.jsx)("div", null, "Loading...")
280
+ }, (0, _react.jsx)(LazyChildren, null, children)) : null : children))));
268
281
  }
269
- var _default = exports.default = (0, _reactIntlNext.injectIntl)(Expand);
282
+ var _default2 = exports.default = (0, _reactIntlNext.injectIntl)(Expand);
@@ -68,7 +68,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
68
68
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
69
69
  var TABLE_WIDTH_INFO_TIMEOUT = 10000;
70
70
  var packageName = "@atlaskit/renderer";
71
- var packageVersion = "124.1.6";
71
+ var packageVersion = "0.0.0-development";
72
72
  var setAsQueryContainerStyles = (0, _react2.css)({
73
73
  containerName: 'ak-renderer-wrapper',
74
74
  containerType: 'inline-size'
@@ -124,7 +124,7 @@ const TableWrapper = ({
124
124
  ref: wrapperRef,
125
125
  onScroll: stickyHeaders ? onScroll : undefined
126
126
  // Adding tabIndex here because this is a scrollable container and it needs to be focusable so keyboard users can scroll it.
127
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex, @atlassian/a11y/no-noninteractive-tabindex
127
+ // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
128
128
  ,
129
129
  tabIndex: 0,
130
130
  role: "region",
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
5
5
  */
6
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
7
  import { css, jsx } from '@emotion/react';
8
- import React, { useCallback, useRef } from 'react';
8
+ import React, { useCallback, useRef, Suspense, lazy } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
10
10
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
11
11
  import { ExpandIconWrapper, ExpandLayoutWrapperWithRef, expandMessages, WidthProvider } from '@atlaskit/editor-common/ui';
@@ -13,6 +13,7 @@ import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset } fr
13
13
  import { default as ChevronRightIconLegacy } from '@atlaskit/icon/glyph/chevron-right';
14
14
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
15
15
  import Tooltip from '@atlaskit/tooltip';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import _uniqueId from 'lodash/uniqueId';
17
18
  import { injectIntl } from 'react-intl-next';
18
19
  import { MODE, PLATFORM } from '../analytics/events';
@@ -123,6 +124,17 @@ const clearNextSiblingMarginTopStyle = css({
123
124
  marginTop: '0 !important'
124
125
  }
125
126
  });
127
+
128
+ // Lazy-loaded children component
129
+ const LazyChildren = /*#__PURE__*/lazy(() => {
130
+ return Promise.resolve({
131
+ default: ({
132
+ children
133
+ }) => {
134
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children);
135
+ }
136
+ });
137
+ });
126
138
  const Container = props => {
127
139
  return jsx("div", _extends({
128
140
  css: [containerStyles, props['data-node-type'] === 'expand' && containerStylesDataNodeTypeExpand, props.expanded && containerStylesExpanded, props.focused && containerStylesFocused]
@@ -244,6 +256,8 @@ function Expand({
244
256
  className: `${nodeType}-content-wrapper`
245
257
  }, jsx(WidthProvider, null, jsx("div", {
246
258
  css: clearNextSiblingMarginTopStyle
247
- }), children))));
259
+ }), fg('hot-121622_lazy_load_expand_content') ? expanded ? jsx(Suspense, {
260
+ fallback: jsx("div", null, "Loading...")
261
+ }, jsx(LazyChildren, null, children)) : null : children))));
248
262
  }
249
263
  export default injectIntl(Expand);
@@ -54,7 +54,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
54
54
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
55
55
  const TABLE_WIDTH_INFO_TIMEOUT = 10000;
56
56
  const packageName = "@atlaskit/renderer";
57
- const packageVersion = "124.1.6";
57
+ const packageVersion = "0.0.0-development";
58
58
  const setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
@@ -146,7 +146,7 @@ var TableWrapper = function TableWrapper(_ref2) {
146
146
  ref: wrapperRef,
147
147
  onScroll: stickyHeaders ? onScroll : undefined
148
148
  // Adding tabIndex here because this is a scrollable container and it needs to be focusable so keyboard users can scroll it.
149
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex, @atlassian/a11y/no-noninteractive-tabindex
149
+ // eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
150
150
  ,
151
151
  tabIndex: 0,
152
152
  role: "region",
@@ -8,7 +8,7 @@ var _excluded = ["expanded"];
8
8
  */
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
- import React, { useCallback, useRef } from 'react';
11
+ import React, { useCallback, useRef, Suspense, lazy } from 'react';
12
12
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
13
13
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
14
14
  import { ExpandIconWrapper, ExpandLayoutWrapperWithRef, expandMessages, WidthProvider } from '@atlaskit/editor-common/ui';
@@ -16,6 +16,7 @@ import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset } fr
16
16
  import { default as ChevronRightIconLegacy } from '@atlaskit/icon/glyph/chevron-right';
17
17
  import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
18
18
  import Tooltip from '@atlaskit/tooltip';
19
+ import { fg } from '@atlaskit/platform-feature-flags';
19
20
  import _uniqueId from 'lodash/uniqueId';
20
21
  import { injectIntl } from 'react-intl-next';
21
22
  import { MODE, PLATFORM } from '../analytics/events';
@@ -126,6 +127,16 @@ var clearNextSiblingMarginTopStyle = css({
126
127
  marginTop: '0 !important'
127
128
  }
128
129
  });
130
+
131
+ // Lazy-loaded children component
132
+ var LazyChildren = /*#__PURE__*/lazy(function () {
133
+ return Promise.resolve({
134
+ default: function _default(_ref) {
135
+ var children = _ref.children;
136
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children);
137
+ }
138
+ });
139
+ });
129
140
  var Container = function Container(props) {
130
141
  return jsx("div", _extends({
131
142
  css: [containerStyles, props['data-node-type'] === 'expand' && containerStylesDataNodeTypeExpand, props.expanded && containerStylesExpanded, props.focused && containerStylesFocused]
@@ -169,15 +180,15 @@ function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
169
180
  eventType: EVENT_TYPE.TRACK
170
181
  });
171
182
  }
172
- function Expand(_ref) {
173
- var title = _ref.title,
174
- children = _ref.children,
175
- nodeType = _ref.nodeType,
176
- intl = _ref.intl,
177
- fireAnalyticsEvent = _ref.fireAnalyticsEvent,
178
- localId = _ref.localId,
179
- nestedHeaderIds = _ref.nestedHeaderIds,
180
- rendererAppearance = _ref.rendererAppearance;
183
+ function Expand(_ref2) {
184
+ var title = _ref2.title,
185
+ children = _ref2.children,
186
+ nodeType = _ref2.nodeType,
187
+ intl = _ref2.intl,
188
+ fireAnalyticsEvent = _ref2.fireAnalyticsEvent,
189
+ localId = _ref2.localId,
190
+ nestedHeaderIds = _ref2.nestedHeaderIds,
191
+ rendererAppearance = _ref2.rendererAppearance;
181
192
  var _React$useState = React.useState(false),
182
193
  _React$useState2 = _slicedToArray(_React$useState, 2),
183
194
  expanded = _React$useState2[0],
@@ -255,6 +266,8 @@ function Expand(_ref) {
255
266
  className: "".concat(nodeType, "-content-wrapper")
256
267
  }, jsx(WidthProvider, null, jsx("div", {
257
268
  css: clearNextSiblingMarginTopStyle
258
- }), children))));
269
+ }), fg('hot-121622_lazy_load_expand_content') ? expanded ? jsx(Suspense, {
270
+ fallback: jsx("div", null, "Loading...")
271
+ }, jsx(LazyChildren, null, children)) : null : children))));
259
272
  }
260
273
  export default injectIntl(Expand);
@@ -59,7 +59,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
59
59
  // we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
60
60
  var TABLE_WIDTH_INFO_TIMEOUT = 10000;
61
61
  var packageName = "@atlaskit/renderer";
62
- var packageVersion = "124.1.6";
62
+ var packageVersion = "0.0.0-development";
63
63
  var setAsQueryContainerStyles = css({
64
64
  containerName: 'ak-renderer-wrapper',
65
65
  containerType: 'inline-size'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "124.1.7",
3
+ "version": "124.2.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/status": "^3.0.0",
58
58
  "@atlaskit/task-decision": "^19.2.0",
59
59
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^13.6.0",
60
+ "@atlaskit/tmp-editor-statsig": "^13.9.0",
61
61
  "@atlaskit/tokens": "^6.4.0",
62
62
  "@atlaskit/tooltip": "^20.5.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": "^110.9.0",
74
+ "@atlaskit/editor-common": "^110.10.0",
75
75
  "@atlaskit/link-provider": "^4.0.0",
76
76
  "@atlaskit/media-core": "^37.0.0",
77
77
  "react": "^18.2.0",
@@ -89,8 +89,8 @@
89
89
  "@atlaskit/media-core": "^37.0.0",
90
90
  "@atlaskit/media-integration-test-helpers": "workspace:^",
91
91
  "@atlaskit/media-test-helpers": "^39.0.0",
92
- "@atlaskit/mention": "^24.2.0",
93
- "@atlaskit/modal-dialog": "^14.4.0",
92
+ "@atlaskit/mention": "^24.3.0",
93
+ "@atlaskit/modal-dialog": "^14.5.0",
94
94
  "@atlaskit/navigation-next": "patch:@atlaskit/navigation-next@npm%3A9.0.17#~/.yarn/patches/@atlaskit-navigation-next-npm-9.0.17-958ca0ab9d.patch",
95
95
  "@atlaskit/profilecard": "^24.18.0",
96
96
  "@atlaskit/util-data-test": "^18.3.0",
@@ -250,6 +250,9 @@
250
250
  },
251
251
  "platform_editor_text_highlight_padding": {
252
252
  "type": "boolean"
253
+ },
254
+ "hot-121622_lazy_load_expand_content": {
255
+ "type": "boolean"
253
256
  }
254
257
  }
255
258
  }