@atlaskit/renderer 109.2.7 → 109.3.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.
@@ -29,7 +29,8 @@ export default function BlockCard(props) {
29
29
  smartLinks = props.smartLinks,
30
30
  isNodeNested = props.isNodeNested;
31
31
  var _ref = smartLinks || {},
32
- showServerActions = _ref.showServerActions;
32
+ showServerActions = _ref.showServerActions,
33
+ actionOptions = _ref.actionOptions;
33
34
  var onClick = getCardClickHandler(eventHandlers, url);
34
35
  var platform = useMemo(function () {
35
36
  return getPlatform(rendererAppearance);
@@ -39,7 +40,9 @@ export default function BlockCard(props) {
39
40
  data: data,
40
41
  onClick: onClick,
41
42
  container: portal,
42
- isDatasource: !!props.datasource
43
+ isDatasource: !!props.datasource,
44
+ actionOptions: actionOptions,
45
+ showServerActions: showServerActions
43
46
  };
44
47
  var analyticsData = {
45
48
  attributes: {
@@ -116,9 +119,7 @@ export default function BlockCard(props) {
116
119
  unsupportedComponent: UnsupportedBlock
117
120
  }, cardProps), jsx(Card, _extends({
118
121
  appearance: "block",
119
- showActions: rendererAppearance !== 'mobile',
120
- platform: platform,
121
- showServerActions: showServerActions
122
+ platform: platform
122
123
  }, cardProps, {
123
124
  onError: onError
124
125
  })))));
@@ -30,6 +30,9 @@ export default function EmbedCard(props) {
30
30
  smartLinks = props.smartLinks;
31
31
  var embedIframeRef = useRef(null);
32
32
  var onClick = getCardClickHandler(eventHandlers, url);
33
+ var _ref = smartLinks || {},
34
+ showServerActions = _ref.showServerActions,
35
+ actionOptions = _ref.actionOptions;
33
36
  var platform = useMemo(function () {
34
37
  return getPlatform(rendererAppearance);
35
38
  }, [rendererAppearance]);
@@ -39,8 +42,9 @@ export default function EmbedCard(props) {
39
42
  onClick: onClick,
40
43
  container: portal,
41
44
  platform: platform,
42
- showActions: platform === 'web',
43
- frameStyle: (_smartLinks$frameStyl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle) !== null && _smartLinks$frameStyl !== void 0 ? _smartLinks$frameStyl : getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? 'show' : undefined
45
+ frameStyle: (_smartLinks$frameStyl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle) !== null && _smartLinks$frameStyl !== void 0 ? _smartLinks$frameStyl : getBooleanFF('platform.editor.show-embed-card-frame-renderer') ? 'show' : undefined,
46
+ actionOptions: actionOptions,
47
+ showServerActions: showServerActions
44
48
  };
45
49
  var _useState = useState(null),
46
50
  _useState2 = _slicedToArray(_useState, 2),
@@ -80,8 +84,8 @@ export default function EmbedCard(props) {
80
84
  hasPreview = _useState6[0],
81
85
  setPreviewAvailableState = _useState6[1];
82
86
  var cardContext = useContext(SmartCardContext);
83
- var onResolve = function onResolve(_ref) {
84
- var resolvedAspectRatio = _ref.aspectRatio;
87
+ var onResolve = function onResolve(_ref2) {
88
+ var resolvedAspectRatio = _ref2.aspectRatio;
85
89
  var hasPreviewOnResolve = !!(cardContext && url && cardContext.extractors.getPreview(url, platform));
86
90
  if (!hasPreviewOnResolve) {
87
91
  setPreviewAvailableState(false);
@@ -97,8 +101,8 @@ export default function EmbedCard(props) {
97
101
  };
98
102
  return jsx(AnalyticsContext, {
99
103
  data: analyticsData
100
- }, jsx(WidthConsumer, null, function (_ref2) {
101
- var documentWidth = _ref2.width;
104
+ }, jsx(WidthConsumer, null, function (_ref3) {
105
+ var documentWidth = _ref3.width;
102
106
  var isFullWidth = rendererAppearance === 'full-width';
103
107
  var containerWidth = documentWidth;
104
108
  if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && !containerWidth) {
@@ -116,8 +120,8 @@ export default function EmbedCard(props) {
116
120
  }
117
121
  var lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
118
122
  var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
119
- var onError = function onError(_ref3) {
120
- var err = _ref3.err;
123
+ var onError = function onError(_ref4) {
124
+ var err = _ref4.err;
121
125
  if (err) {
122
126
  throw err;
123
127
  }
@@ -24,6 +24,7 @@ var InlineCard = function InlineCard(props) {
24
24
  showAuthTooltip = _ref.showAuthTooltip,
25
25
  hideHoverPreview = _ref.hideHoverPreview,
26
26
  showServerActions = _ref.showServerActions,
27
+ actionOptions = _ref.actionOptions,
27
28
  ssr = _ref.ssr;
28
29
  var analyticsData = {
29
30
  attributes: {
@@ -40,6 +41,7 @@ var InlineCard = function InlineCard(props) {
40
41
  url: url,
41
42
  showAuthTooltip: showAuthTooltip,
42
43
  showHoverPreview: !hideHoverPreview,
44
+ actionOptions: actionOptions,
43
45
  showServerActions: showServerActions,
44
46
  onClick: onClick
45
47
  }));
@@ -62,6 +64,7 @@ var InlineCard = function InlineCard(props) {
62
64
  appearance: "inline",
63
65
  showHoverPreview: !hideHoverPreview,
64
66
  showAuthTooltip: showAuthTooltip,
67
+ actionOptions: actionOptions,
65
68
  showServerActions: showServerActions
66
69
  }, cardProps, {
67
70
  onResolve: function onResolve(data) {
@@ -116,10 +116,7 @@ var MediaSingle = function MediaSingle(props) {
116
116
  var isFullWidth = rendererAppearance === 'full-width';
117
117
  var calcDimensions = function calcDimensions(mediaContainerWidth) {
118
118
  var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
119
- var isPixel = widthType === 'pixel';
120
-
121
- // max width and height are already handled in mediaSingle
122
- var maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
119
+ var maxWidth = containerWidth;
123
120
  var maxHeight = height / width * maxWidth;
124
121
  var cardDimensions = {
125
122
  width: "".concat(maxWidth, "px"),
@@ -9,7 +9,7 @@ var _templateObject, _templateObject2;
9
9
  import { jsx } from '@emotion/react';
10
10
  // eslint-disable-next-line @typescript-eslint/no-duplicate-imports
11
11
  import { css } from '@emotion/react';
12
- import { N40, N50 } from '@atlaskit/theme/colors';
12
+ import { N30, N40 } from '@atlaskit/theme/colors';
13
13
  import React, { useState } from 'react';
14
14
  import { renderExtension } from './extension';
15
15
  import ExtensionRenderer from '../../ui/ExtensionRenderer';
@@ -43,7 +43,7 @@ var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActions(_re
43
43
  }, [updateActiveChild, children]);
44
44
  return actions;
45
45
  };
46
- var navigationCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n background-color: ", ";\n\n .mbe-add-tab-button,\n .mbe-remove-tab {\n display: none;\n }\n"])), "var(--ds-border, ".concat(N40, ")"), "var(--ds-background-inverse-subtle, ".concat(N50, ")"));
46
+ var navigationCSS = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // make sure the user can't see a range selection inside the navigation\n // This is really important to keep the navigation working properly\n user-select: none;\n -webkit-user-modify: read-only;\n border: 1px solid ", ";\n border-bottom: none;\n .mbe-add-tab-button,\n .mbe-remove-tab {\n display: none;\n }\n"])), "var(--ds-border, ".concat(N40, ")"));
47
47
  var MultiBodiedExtension = function MultiBodiedExtension(props) {
48
48
  var children = props.children,
49
49
  _props$layout = props.layout,
@@ -67,7 +67,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
67
67
  updateActiveChild: updateActiveChild,
68
68
  children: children
69
69
  });
70
- var containerCSS = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-height: 100px;\n\n .multiBodiedExtension--frames > [data-extension-frame='true'] {\n display: none;\n }\n\n .multiBodiedExtension--frames\n > [data-extension-frame='true']:nth-of-type(", ") {\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n }\n "])), activeChildIndex + 1, "var(--ds-border, ".concat(N50, ")"));
70
+ var containerCSS = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0;\n border-radius: ", ";\n position: relative;\n vertical-align: middle;\n min-height: 100px;\n .ak-renderer-extension {\n margin-top: 0 !important;\n }\n\n .multiBodiedExtension--frames > [data-extension-frame='true'] {\n display: none;\n }\n\n .multiBodiedExtension--frames\n > [data-extension-frame='true']:nth-of-type(", ") {\n padding: ", " !important;\n border: 1px solid ", ";\n display: block;\n min-height: 100px;\n background: ", ";\n padding-left: ", ";\n padding-right: ", ";\n\n .bodiedExtensionView-content-wrap {\n margin-top: ", " !important;\n }\n .extensionView-content-wrap {\n margin-top: ", " !important;\n }\n }\n "])), "var(--ds-border-radius, 3px)", activeChildIndex + 1, "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(N30, ")"), "var(--ds-surface, white)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)");
71
71
  var isTopLevel = path.length < 1;
72
72
  var centerAlignClass = isTopLevel && ['wide', 'full-width'].includes(layout) ? RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
73
73
  function renderMbeContent(width) {
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { isHex, isRgb, rgbToHex, tableBackgroundColorPalette, getDarkModeLCHColor } from '@atlaskit/adf-schema';
3
+ import { tableBackgroundColorPalette, getDarkModeLCHColor } from '@atlaskit/adf-schema';
4
4
  import { useThemeObserver } from '@atlaskit/tokens';
5
5
  import { SortOrder } from '@atlaskit/editor-common/types';
6
6
  import { hexToEditorBackgroundPaletteRawValue } from '@atlaskit/editor-palette';
@@ -10,7 +10,6 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/anal
10
10
  import { RendererCssClassName } from '../../consts';
11
11
  import { useIntl } from 'react-intl-next';
12
12
  import { tableCellMessages } from '../../messages';
13
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
13
  var IgnoreSorting = ['LABEL', 'INPUT'];
15
14
  var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
16
15
  switch (currentSortOrder) {
@@ -62,38 +61,6 @@ var getDataAttributes = function getDataAttributes(colwidth, background) {
62
61
  }
63
62
  return attrs;
64
63
  };
65
-
66
- /**
67
- * This function is duplicated in
68
- * - @atlaskit/adf-schema
69
- * - ../marks/textColor.tsx
70
- * it takes a color string, and if the color string is a hex or rgb value
71
- * it will invert the color and return the inverted color.
72
- */
73
- function invertCustomColor(customColor) {
74
- var hex;
75
- if (isHex(customColor)) {
76
- hex = customColor;
77
- } else if (isRgb(customColor)) {
78
- hex = rgbToHex(customColor);
79
- if (hex === null) {
80
- // in some cases the rgb color is invalid, in this case we just return the color
81
- // See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
82
- // to align with the rgbToHex function
83
- return customColor;
84
- }
85
- } else {
86
- return customColor;
87
- }
88
- var hexWithoutHash = hex.replace('#', '');
89
-
90
- // This inverts the hex color by
91
- // 1. converting the hex code to a number
92
- // 2. XORing it with 0xffffff
93
- // 3. Converting the result back to hex
94
- // 4. Removing the leading 1 from the result
95
- return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
96
- }
97
64
  var getStyle = function getStyle(_ref) {
98
65
  var background = _ref.background,
99
66
  colGroupWidth = _ref.colGroupWidth,
@@ -127,12 +94,7 @@ var getStyle = function getStyle(_ref) {
127
94
  // if we have a custom color, we need to check if we are in dark mode
128
95
  if (colorMode === 'dark') {
129
96
  // if we are in dark mode, we need to invert the color
130
- // and if the feature flag is enabled we need to use the LCH conversion method
131
- if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
132
- style.backgroundColor = getDarkModeLCHColor(background);
133
- } else {
134
- style.backgroundColor = invertCustomColor(background);
135
- }
97
+ style.backgroundColor = getDarkModeLCHColor(background);
136
98
  } else {
137
99
  // if we are in light mode, we can just set the color
138
100
  style.backgroundColor = background;
@@ -45,7 +45,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "109.2.7";
48
+ var packageVersion = "109.3.1";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -3,6 +3,12 @@ export interface SmartLinksOptions {
3
3
  ssr?: boolean;
4
4
  showAuthTooltip?: boolean;
5
5
  hideHoverPreview?: boolean;
6
+ /**
7
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
8
+ *
9
+ * Prefer `actionOptions` prop.
10
+ */
6
11
  showServerActions?: boolean;
12
+ actionOptions?: CardProps['actionOptions'];
7
13
  frameStyle?: CardProps['frameStyle'];
8
14
  }
@@ -3,6 +3,12 @@ export interface SmartLinksOptions {
3
3
  ssr?: boolean;
4
4
  showAuthTooltip?: boolean;
5
5
  hideHoverPreview?: boolean;
6
+ /**
7
+ * @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-6348 Internal documentation for deprecation (no external access)}
8
+ *
9
+ * Prefer `actionOptions` prop.
10
+ */
6
11
  showServerActions?: boolean;
12
+ actionOptions?: CardProps['actionOptions'];
7
13
  frameStyle?: CardProps['frameStyle'];
8
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.2.7",
3
+ "version": "109.3.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,21 +25,21 @@
25
25
  "runReact18": false
26
26
  },
27
27
  "dependencies": {
28
- "@atlaskit/adf-schema": "^35.3.0",
28
+ "@atlaskit/adf-schema": "^35.5.1",
29
29
  "@atlaskit/adf-utils": "^19.0.0",
30
30
  "@atlaskit/analytics-listeners": "^8.9.0",
31
31
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
32
32
  "@atlaskit/analytics-next": "^9.1.0",
33
- "@atlaskit/button": "^17.2.0",
33
+ "@atlaskit/button": "^17.3.0",
34
34
  "@atlaskit/code": "^15.1.0",
35
- "@atlaskit/editor-common": "^77.0.0",
35
+ "@atlaskit/editor-common": "^77.2.0",
36
36
  "@atlaskit/editor-json-transformer": "^8.10.0",
37
37
  "@atlaskit/editor-palette": "1.5.2",
38
38
  "@atlaskit/editor-prosemirror": "1.1.0",
39
39
  "@atlaskit/editor-shared-styles": "^2.9.0",
40
40
  "@atlaskit/emoji": "^67.6.0",
41
41
  "@atlaskit/icon": "^22.0.0",
42
- "@atlaskit/link-datasource": "^1.19.0",
42
+ "@atlaskit/link-datasource": "^1.22.0",
43
43
  "@atlaskit/media-card": "^77.7.0",
44
44
  "@atlaskit/media-client": "^26.1.0",
45
45
  "@atlaskit/media-client-react": "^2.0.0",
@@ -48,11 +48,11 @@
48
48
  "@atlaskit/media-ui": "^25.0.0",
49
49
  "@atlaskit/media-viewer": "^48.2.0",
50
50
  "@atlaskit/platform-feature-flags": "^0.2.0",
51
- "@atlaskit/smart-card": "^26.45.0",
51
+ "@atlaskit/smart-card": "^26.46.0",
52
52
  "@atlaskit/status": "^1.4.0",
53
53
  "@atlaskit/task-decision": "^17.9.0",
54
54
  "@atlaskit/theme": "^12.6.0",
55
- "@atlaskit/tokens": "^1.34.0",
55
+ "@atlaskit/tokens": "^1.35.0",
56
56
  "@atlaskit/tooltip": "^18.1.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@emotion/react": "^11.7.1",
@@ -63,7 +63,7 @@
63
63
  "uuid": "^3.1.0"
64
64
  },
65
65
  "peerDependencies": {
66
- "@atlaskit/link-provider": "^1.6.2",
66
+ "@atlaskit/link-provider": "^1.7.0",
67
67
  "@atlaskit/media-core": "^34.1.2",
68
68
  "react": "^16.8.0",
69
69
  "react-dom": "^16.8.0"
@@ -73,7 +73,7 @@
73
73
  "@af/visual-regression": "*",
74
74
  "@atlaskit/analytics-gas-types": "^5.1.0",
75
75
  "@atlaskit/css-reset": "^6.6.0",
76
- "@atlaskit/link-provider": "^1.6.0",
76
+ "@atlaskit/link-provider": "^1.7.0",
77
77
  "@atlaskit/link-test-helpers": "^6.2.0",
78
78
  "@atlaskit/media-core": "^34.1.0",
79
79
  "@atlaskit/media-integration-test-helpers": "^3.0.0",
@@ -126,9 +126,6 @@
126
126
  "type": "boolean",
127
127
  "referenceOnly": "true"
128
128
  },
129
- "platform.editor.use-lch-for-color-inversion_1qv8ol": {
130
- "type": "boolean"
131
- },
132
129
  "platform.editor.show-embed-card-frame-renderer": {
133
130
  "type": "boolean"
134
131
  }