@atlaskit/renderer 124.5.2 → 124.6.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,20 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 124.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`dde0a58b7f0e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dde0a58b7f0e5) -
8
+ Improve expand lazy loading children to render on initial open and remain in document
9
+
10
+ ## 124.5.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [`e22968790f2b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e22968790f2b5) -
15
+ [ux] [EDITOR-2374] prevent style overrides on codemarks in excerpts
16
+ - Updated dependencies
17
+
3
18
  ## 124.5.2
4
19
 
5
20
  ### Patch Changes
@@ -212,6 +212,10 @@ function Expand(_ref2) {
212
212
  _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
213
213
  focused = _React$useState4[0],
214
214
  setFocused = _React$useState4[1];
215
+ var _React$useState5 = _react2.default.useState(false),
216
+ _React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
217
+ hasLoadedChildren = _React$useState6[0],
218
+ setHasLoadedChildren = _React$useState6[1];
215
219
  var isMobile = false;
216
220
  var label = intl.formatMessage(expanded ? _ui.expandMessages.collapseNode : _ui.expandMessages.expandNode);
217
221
  var _useRef = (0, _react2.useRef)((0, _uniqueId2.default)('expand-title-')),
@@ -235,13 +239,21 @@ function Expand(_ref2) {
235
239
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? (0, _react.jsx)(_activeHeaderIdProvider.ActiveHeaderIdConsumer, {
236
240
  nestedHeaderIds: nestedHeaderIds,
237
241
  onNestedHeaderIdMatch: function onNestedHeaderIdMatch() {
238
- return setExpanded(true);
242
+ if (!hasLoadedChildren) {
243
+ setHasLoadedChildren(true);
244
+ }
245
+ setExpanded(true);
239
246
  }
240
247
  }) : null, (0, _react.jsx)(TitleContainer, {
241
248
  onClick: function onClick(e) {
242
249
  e.preventDefault();
243
250
  e.stopPropagation();
244
251
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
252
+
253
+ // Mark children as loaded when expanding for the first time
254
+ if (!expanded && !hasLoadedChildren) {
255
+ setHasLoadedChildren(true);
256
+ }
245
257
  setExpanded(!expanded);
246
258
  e.persist();
247
259
  // @ts-ignore detail doesn't exist on type
@@ -283,7 +295,7 @@ function Expand(_ref2) {
283
295
  className: "".concat(nodeType, "-content-wrapper")
284
296
  }, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
285
297
  css: clearNextSiblingMarginTopStyle
286
- }), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? expanded ? (0, _react.jsx)(_react2.Suspense, {
298
+ }), (0, _platformFeatureFlags.fg)('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? (0, _react.jsx)(_react2.Suspense, {
287
299
  fallback: (0, _react.jsx)("div", null, "Loading...")
288
300
  }, (0, _react.jsx)(LazyChildren, null, children)) : null : children))));
289
301
  }
@@ -717,7 +717,7 @@ var codeMarkSharedStyles = (0, _react.css)({
717
717
  });
718
718
  var extensionStyle = (0, _react.css)({
719
719
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
720
- '.ak-renderer-extension :not([data-inline-card-lozenge] *)': {
720
+ '.ak-renderer-extension :not([data-inline-card-lozenge] *, code)': {
721
721
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
722
722
  fontSize: 'var(--ak-renderer-base-font-size)'
723
723
  }
@@ -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.5.1";
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'
@@ -198,6 +198,7 @@ function Expand({
198
198
  }) {
199
199
  const [expanded, setExpanded] = React.useState(false);
200
200
  const [focused, setFocused] = React.useState(false);
201
+ const [hasLoadedChildren, setHasLoadedChildren] = React.useState(false);
201
202
  const isMobile = false;
202
203
  const label = intl.formatMessage(expanded ? expandMessages.collapseNode : expandMessages.expandNode);
203
204
  const {
@@ -217,12 +218,22 @@ function Expand({
217
218
  focused: focused
218
219
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? jsx(ActiveHeaderIdConsumer, {
219
220
  nestedHeaderIds: nestedHeaderIds,
220
- onNestedHeaderIdMatch: () => setExpanded(true)
221
+ onNestedHeaderIdMatch: () => {
222
+ if (!hasLoadedChildren) {
223
+ setHasLoadedChildren(true);
224
+ }
225
+ setExpanded(true);
226
+ }
221
227
  }) : null, jsx(TitleContainer, {
222
228
  onClick: e => {
223
229
  e.preventDefault();
224
230
  e.stopPropagation();
225
231
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
232
+
233
+ // Mark children as loaded when expanding for the first time
234
+ if (!expanded && !hasLoadedChildren) {
235
+ setHasLoadedChildren(true);
236
+ }
226
237
  setExpanded(!expanded);
227
238
  e.persist();
228
239
  // @ts-ignore detail doesn't exist on type
@@ -264,7 +275,7 @@ function Expand({
264
275
  className: `${nodeType}-content-wrapper`
265
276
  }, jsx(WidthProvider, null, jsx("div", {
266
277
  css: clearNextSiblingMarginTopStyle
267
- }), fg('hot-121622_lazy_load_expand_content') ? expanded ? jsx(Suspense, {
278
+ }), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? jsx(Suspense, {
268
279
  fallback: jsx("div", null, "Loading...")
269
280
  }, jsx(LazyChildren, null, children)) : null : children))));
270
281
  }
@@ -824,7 +824,7 @@ const codeMarkSharedStyles = css({
824
824
  });
825
825
  const extensionStyle = css({
826
826
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
827
- '.ak-renderer-extension :not([data-inline-card-lozenge] *)': {
827
+ '.ak-renderer-extension :not([data-inline-card-lozenge] *, code)': {
828
828
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
829
829
  fontSize: 'var(--ak-renderer-base-font-size)'
830
830
  }
@@ -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.5.1";
57
+ const packageVersion = "0.0.0-development";
58
58
  const setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
@@ -203,6 +203,10 @@ function Expand(_ref2) {
203
203
  _React$useState4 = _slicedToArray(_React$useState3, 2),
204
204
  focused = _React$useState4[0],
205
205
  setFocused = _React$useState4[1];
206
+ var _React$useState5 = React.useState(false),
207
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
208
+ hasLoadedChildren = _React$useState6[0],
209
+ setHasLoadedChildren = _React$useState6[1];
206
210
  var isMobile = false;
207
211
  var label = intl.formatMessage(expanded ? expandMessages.collapseNode : expandMessages.expandNode);
208
212
  var _useRef = useRef(_uniqueId('expand-title-')),
@@ -226,13 +230,21 @@ function Expand(_ref2) {
226
230
  }, nestedHeaderIds && nestedHeaderIds.length > 0 ? jsx(ActiveHeaderIdConsumer, {
227
231
  nestedHeaderIds: nestedHeaderIds,
228
232
  onNestedHeaderIdMatch: function onNestedHeaderIdMatch() {
229
- return setExpanded(true);
233
+ if (!hasLoadedChildren) {
234
+ setHasLoadedChildren(true);
235
+ }
236
+ setExpanded(true);
230
237
  }
231
238
  }) : null, jsx(TitleContainer, {
232
239
  onClick: function onClick(e) {
233
240
  e.preventDefault();
234
241
  e.stopPropagation();
235
242
  fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
243
+
244
+ // Mark children as loaded when expanding for the first time
245
+ if (!expanded && !hasLoadedChildren) {
246
+ setHasLoadedChildren(true);
247
+ }
236
248
  setExpanded(!expanded);
237
249
  e.persist();
238
250
  // @ts-ignore detail doesn't exist on type
@@ -274,7 +286,7 @@ function Expand(_ref2) {
274
286
  className: "".concat(nodeType, "-content-wrapper")
275
287
  }, jsx(WidthProvider, null, jsx("div", {
276
288
  css: clearNextSiblingMarginTopStyle
277
- }), fg('hot-121622_lazy_load_expand_content') ? expanded ? jsx(Suspense, {
289
+ }), fg('hot-121622_lazy_load_expand_content') ? hasLoadedChildren ? jsx(Suspense, {
278
290
  fallback: jsx("div", null, "Loading...")
279
291
  }, jsx(LazyChildren, null, children)) : null : children))));
280
292
  }
@@ -710,7 +710,7 @@ var codeMarkSharedStyles = css({
710
710
  });
711
711
  var extensionStyle = css({
712
712
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
713
- '.ak-renderer-extension :not([data-inline-card-lozenge] *)': {
713
+ '.ak-renderer-extension :not([data-inline-card-lozenge] *, code)': {
714
714
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
715
715
  fontSize: 'var(--ak-renderer-base-font-size)'
716
716
  }
@@ -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.5.1";
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.5.2",
3
+ "version": "124.6.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,8 +57,8 @@
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.12.0",
61
- "@atlaskit/tokens": "^6.5.0",
60
+ "@atlaskit/tmp-editor-statsig": "^13.13.0",
61
+ "@atlaskit/tokens": "^7.0.0",
62
62
  "@atlaskit/tooltip": "^20.5.0",
63
63
  "@atlaskit/visually-hidden": "^3.0.0",
64
64
  "@babel/runtime": "^7.0.0",