@atlaskit/renderer 124.9.10 → 124.10.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,27 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 124.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e5c510a42227e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e5c510a42227e) -
8
+ [ux] Disable preview modals within preview panels
9
+
10
+ ### Patch Changes
11
+
12
+ - [`0f988dbb4b54b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f988dbb4b54b) -
13
+ Added an experiment and implemented changes to disable lazy loading of internal images found
14
+ within Confluence PDF export pages
15
+ - Updated dependencies
16
+
17
+ ## 124.9.11
18
+
19
+ ### Patch Changes
20
+
21
+ - [`9630c61136f9b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9630c61136f9b) -
22
+ Fixed bug where percentage based width attributes was being used as an aboslute pixel number
23
+ instead of correctly calculating the width.
24
+
3
25
  ## 124.9.10
4
26
 
5
27
  ### Patch Changes
@@ -74,6 +74,9 @@
74
74
  {
75
75
  "path": "../../../linking-platform/link-extractors/afm-cc/tsconfig.json"
76
76
  },
77
+ {
78
+ "path": "../../../linking-platform/linking-common/afm-cc/tsconfig.json"
79
+ },
77
80
  {
78
81
  "path": "../../../media/media-card/afm-cc/tsconfig.json"
79
82
  },
@@ -11,6 +11,7 @@ var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
12
  var _linkProvider = require("@atlaskit/link-provider");
13
13
  var _smartCard = require("@atlaskit/smart-card");
14
+ var _utils = require("@atlaskit/linking-common/utils");
14
15
  var _hooks = require("@atlaskit/smart-card/hooks");
15
16
  var _ssr = require("@atlaskit/smart-card/ssr");
16
17
  var _ui = require("@atlaskit/editor-common/ui");
@@ -97,12 +98,16 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
97
98
  var isPreviewModalAvailable = Boolean(preview);
98
99
  var isPreviewAvailable = isPreviewModalAvailable || isPreviewPanelAvailable;
99
100
  var showPanelButtonIcon = isPreviewPanelAvailable ? 'panel' : isPreviewModalAvailable ? 'modal' : undefined;
101
+
102
+ // When inside preview panel iframe, hide the overlay button
103
+ var isInPreviewPanel = (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel_modal', 'cohort', 'test') && (0, _utils.isWithinPreviewPanelIFrame)();
104
+ var showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
100
105
  var Overlay = isPreviewAvailable ? HoverLinkOverlayWithCondition : HoverLinkOverlayNoop;
101
106
  return (0, _react2.jsx)(Overlay, {
102
107
  isVisible: isResolvedViewRendered,
103
108
  url: url,
104
109
  compactPadding: rendererAppearance === 'comment',
105
- showPanelButton: isPreviewAvailable,
110
+ showPanelButton: showPanelButton,
106
111
  showPanelButtonIcon: showPanelButtonIcon,
107
112
  onClick: function onClick(event) {
108
113
  if (isPreviewPanelAvailable) {
@@ -142,7 +142,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
142
142
  var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
143
143
  var cardDimensions = {};
144
144
  if ((0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix')) {
145
- var maxWidth = widthAttr && typeof widthAttr === 'number' ? widthAttr : containerWidth;
145
+ var maxWidth = widthAttr && typeof widthAttr === 'number' && widthType === 'pixel' ? widthAttr : containerWidth;
146
146
  cardDimensions = {
147
147
  width: "".concat(maxWidth, "px"),
148
148
  height: "100%"
@@ -170,7 +170,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
170
170
  cardDimensions: cardDimensions,
171
171
  lineLength: lineLength
172
172
  };
173
- }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr]);
173
+ }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr, widthType]);
174
174
  var originalDimensions = (0, _react.useMemo)(function () {
175
175
  return {
176
176
  width: width,
@@ -330,6 +330,11 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
330
330
  occurrenceKey: occurrenceKey
331
331
  };
332
332
  var Card = enableSyncMediaCard && (0, _platformFeatureFlags.fg)('jfp-magma-ssr-iv-editor-media') ? _mediaCard.CardSync : _mediaCard.Card;
333
+
334
+ // Quick solution to disable lazy loading of images on PDF export pages in Confluence to remedy an issue with images never loading
335
+ // More robust solution will be implemented as part of CCPDF-233 - Link: https://hello.jira.atlassian.cloud/browse/CCPDF-233
336
+ var currentUrl = window.location.href;
337
+ var shouldDisableLazyLoading = (0, _expValEquals.expValEquals)('platform_editor_disable_lazy_load_media', 'isEnabled', true) && currentUrl.includes('/wiki/pdf/spaces/');
333
338
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, getClipboardAttrs({
334
339
  id: id,
335
340
  alt: alt,
@@ -348,7 +353,7 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
348
353
  originalDimensions: originalDimensions,
349
354
  onClick: onCardClick,
350
355
  resizeMode: resizeMode,
351
- isLazy: !isMobile,
356
+ isLazy: !isMobile && !shouldDisableLazyLoading,
352
357
  disableOverlay: disableOverlay,
353
358
  useInlinePlayer: isInlinePlayer,
354
359
  shouldOpenMediaViewer: shouldOpenMediaViewer,
@@ -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 = "0.0.0-development";
71
+ var packageVersion = "124.9.11";
72
72
  var setAsQueryContainerStyles = (0, _react2.css)({
73
73
  containerName: 'ak-renderer-wrapper',
74
74
  containerType: 'inline-size'
@@ -8,6 +8,7 @@ import { Fragment, useState, useMemo } from 'react';
8
8
  import { jsx } from '@emotion/react';
9
9
  import { useSmartCardContext } from '@atlaskit/link-provider';
10
10
  import { Card, getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
11
+ import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
11
12
  import { useSmartLinkActions } from '@atlaskit/smart-card/hooks';
12
13
  import { CardSSR } from '@atlaskit/smart-card/ssr';
13
14
  import { HoverLinkOverlay, UnsupportedInline } from '@atlaskit/editor-common/ui';
@@ -80,12 +81,16 @@ const OverlayWithCardContext = ({
80
81
  const isPreviewModalAvailable = Boolean(preview);
81
82
  const isPreviewAvailable = isPreviewModalAvailable || isPreviewPanelAvailable;
82
83
  const showPanelButtonIcon = isPreviewPanelAvailable ? 'panel' : isPreviewModalAvailable ? 'modal' : undefined;
84
+
85
+ // When inside preview panel iframe, hide the overlay button
86
+ const isInPreviewPanel = expValEquals('platform_hover_card_preview_panel_modal', 'cohort', 'test') && isWithinPreviewPanelIFrame();
87
+ const showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
83
88
  const Overlay = isPreviewAvailable ? HoverLinkOverlayWithCondition : HoverLinkOverlayNoop;
84
89
  return jsx(Overlay, {
85
90
  isVisible: isResolvedViewRendered,
86
91
  url: url,
87
92
  compactPadding: rendererAppearance === 'comment',
88
- showPanelButton: isPreviewAvailable,
93
+ showPanelButton: showPanelButton,
89
94
  showPanelButtonIcon: showPanelButtonIcon,
90
95
  onClick: event => {
91
96
  if (isPreviewPanelAvailable) {
@@ -129,7 +129,7 @@ const MediaSingleWithChildren = props => {
129
129
  const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
130
130
  let cardDimensions = {};
131
131
  if (fg('media-perf-uplift-mutation-fix')) {
132
- const maxWidth = widthAttr && typeof widthAttr === 'number' ? widthAttr : containerWidth;
132
+ const maxWidth = widthAttr && typeof widthAttr === 'number' && widthType === 'pixel' ? widthAttr : containerWidth;
133
133
  cardDimensions = {
134
134
  width: `${maxWidth}px`,
135
135
  height: `100%`
@@ -157,7 +157,7 @@ const MediaSingleWithChildren = props => {
157
157
  cardDimensions,
158
158
  lineLength
159
159
  };
160
- }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr]);
160
+ }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr, widthType]);
161
161
  const originalDimensions = useMemo(() => ({
162
162
  width,
163
163
  height
@@ -266,6 +266,11 @@ export class MediaCardView extends Component {
266
266
  occurrenceKey
267
267
  };
268
268
  const Card = enableSyncMediaCard && fg('jfp-magma-ssr-iv-editor-media') ? CardSync : CardAsync;
269
+
270
+ // Quick solution to disable lazy loading of images on PDF export pages in Confluence to remedy an issue with images never loading
271
+ // More robust solution will be implemented as part of CCPDF-233 - Link: https://hello.jira.atlassian.cloud/browse/CCPDF-233
272
+ const currentUrl = window.location.href;
273
+ const shouldDisableLazyLoading = expValEquals('platform_editor_disable_lazy_load_media', 'isEnabled', true) && currentUrl.includes('/wiki/pdf/spaces/');
269
274
  return /*#__PURE__*/React.createElement("div", _extends({}, getClipboardAttrs({
270
275
  id,
271
276
  alt,
@@ -284,7 +289,7 @@ export class MediaCardView extends Component {
284
289
  originalDimensions: originalDimensions,
285
290
  onClick: onCardClick,
286
291
  resizeMode: resizeMode,
287
- isLazy: !isMobile,
292
+ isLazy: !isMobile && !shouldDisableLazyLoading,
288
293
  disableOverlay: disableOverlay,
289
294
  useInlinePlayer: isInlinePlayer,
290
295
  shouldOpenMediaViewer: shouldOpenMediaViewer,
@@ -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 = "0.0.0-development";
57
+ const packageVersion = "124.9.11";
58
58
  const setAsQueryContainerStyles = css({
59
59
  containerName: 'ak-renderer-wrapper',
60
60
  containerType: 'inline-size'
@@ -9,6 +9,7 @@ import { Fragment, useState, useMemo } from 'react';
9
9
  import { jsx } from '@emotion/react';
10
10
  import { useSmartCardContext } from '@atlaskit/link-provider';
11
11
  import { Card, getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
12
+ import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
12
13
  import { useSmartLinkActions } from '@atlaskit/smart-card/hooks';
13
14
  import { CardSSR } from '@atlaskit/smart-card/ssr';
14
15
  import { HoverLinkOverlay, UnsupportedInline } from '@atlaskit/editor-common/ui';
@@ -88,12 +89,16 @@ var OverlayWithCardContext = function OverlayWithCardContext(_ref) {
88
89
  var isPreviewModalAvailable = Boolean(preview);
89
90
  var isPreviewAvailable = isPreviewModalAvailable || isPreviewPanelAvailable;
90
91
  var showPanelButtonIcon = isPreviewPanelAvailable ? 'panel' : isPreviewModalAvailable ? 'modal' : undefined;
92
+
93
+ // When inside preview panel iframe, hide the overlay button
94
+ var isInPreviewPanel = expValEquals('platform_hover_card_preview_panel_modal', 'cohort', 'test') && isWithinPreviewPanelIFrame();
95
+ var showPanelButton = isInPreviewPanel ? isPreviewPanelAvailable : isPreviewAvailable;
91
96
  var Overlay = isPreviewAvailable ? HoverLinkOverlayWithCondition : HoverLinkOverlayNoop;
92
97
  return jsx(Overlay, {
93
98
  isVisible: isResolvedViewRendered,
94
99
  url: url,
95
100
  compactPadding: rendererAppearance === 'comment',
96
- showPanelButton: isPreviewAvailable,
101
+ showPanelButton: showPanelButton,
97
102
  showPanelButtonIcon: showPanelButtonIcon,
98
103
  onClick: function onClick(event) {
99
104
  if (isPreviewPanelAvailable) {
@@ -132,7 +132,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
132
132
  var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
133
133
  var cardDimensions = {};
134
134
  if (fg('media-perf-uplift-mutation-fix')) {
135
- var maxWidth = widthAttr && typeof widthAttr === 'number' ? widthAttr : containerWidth;
135
+ var maxWidth = widthAttr && typeof widthAttr === 'number' && widthType === 'pixel' ? widthAttr : containerWidth;
136
136
  cardDimensions = {
137
137
  width: "".concat(maxWidth, "px"),
138
138
  height: "100%"
@@ -160,7 +160,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
160
160
  cardDimensions: cardDimensions,
161
161
  lineLength: lineLength
162
162
  };
163
- }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr]);
163
+ }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr, widthType]);
164
164
  var originalDimensions = useMemo(function () {
165
165
  return {
166
166
  width: width,
@@ -321,6 +321,11 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
321
321
  occurrenceKey: occurrenceKey
322
322
  };
323
323
  var Card = enableSyncMediaCard && fg('jfp-magma-ssr-iv-editor-media') ? CardSync : CardAsync;
324
+
325
+ // Quick solution to disable lazy loading of images on PDF export pages in Confluence to remedy an issue with images never loading
326
+ // More robust solution will be implemented as part of CCPDF-233 - Link: https://hello.jira.atlassian.cloud/browse/CCPDF-233
327
+ var currentUrl = window.location.href;
328
+ var shouldDisableLazyLoading = expValEquals('platform_editor_disable_lazy_load_media', 'isEnabled', true) && currentUrl.includes('/wiki/pdf/spaces/');
324
329
  return /*#__PURE__*/React.createElement("div", _extends({}, getClipboardAttrs({
325
330
  id: id,
326
331
  alt: alt,
@@ -339,7 +344,7 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
339
344
  originalDimensions: originalDimensions,
340
345
  onClick: onCardClick,
341
346
  resizeMode: resizeMode,
342
- isLazy: !isMobile,
347
+ isLazy: !isMobile && !shouldDisableLazyLoading,
343
348
  disableOverlay: disableOverlay,
344
349
  useInlinePlayer: isInlinePlayer,
345
350
  shouldOpenMediaViewer: shouldOpenMediaViewer,
@@ -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 = "0.0.0-development";
62
+ var packageVersion = "124.9.11";
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.9.10",
3
+ "version": "124.10.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,6 +43,7 @@
43
43
  "@atlaskit/link": "^3.2.0",
44
44
  "@atlaskit/link-datasource": "^4.29.0",
45
45
  "@atlaskit/link-extractors": "^2.4.0",
46
+ "@atlaskit/linking-common": "^9.8.0",
46
47
  "@atlaskit/media-card": "^79.6.0",
47
48
  "@atlaskit/media-client": "^35.5.0",
48
49
  "@atlaskit/media-client-react": "^4.1.0",
@@ -53,11 +54,11 @@
53
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
55
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
55
56
  "@atlaskit/react-ufo": "^4.14.0",
56
- "@atlaskit/smart-card": "^43.5.0",
57
+ "@atlaskit/smart-card": "^43.6.0",
57
58
  "@atlaskit/status": "^3.0.0",
58
59
  "@atlaskit/task-decision": "^19.2.0",
59
60
  "@atlaskit/theme": "^21.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^13.26.0",
61
+ "@atlaskit/tmp-editor-statsig": "^13.28.0",
61
62
  "@atlaskit/tokens": "^7.1.0",
62
63
  "@atlaskit/tooltip": "^20.7.0",
63
64
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -71,7 +72,7 @@
71
72
  "uuid": "^3.1.0"
72
73
  },
73
74
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^110.21.0",
75
+ "@atlaskit/editor-common": "^110.22.0",
75
76
  "@atlaskit/link-provider": "^4.0.0",
76
77
  "@atlaskit/media-core": "^37.0.0",
77
78
  "react": "^18.2.0",
@@ -85,7 +86,6 @@
85
86
  "@atlaskit/css-reset": "^7.3.0",
86
87
  "@atlaskit/link-provider": "^4.0.0",
87
88
  "@atlaskit/link-test-helpers": "^8.4.0",
88
- "@atlaskit/linking-common": "^9.7.0",
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",