@atlaskit/renderer 109.2.6 → 109.3.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 +19 -0
- package/dist/cjs/react/marks/textColor.js +1 -38
- package/dist/cjs/react/nodes/blockCard.js +6 -5
- package/dist/cjs/react/nodes/embedCard.js +12 -8
- package/dist/cjs/react/nodes/inlineCard.js +3 -0
- package/dist/cjs/react/nodes/mediaSingle/index.js +1 -4
- package/dist/cjs/react/nodes/multiBodiedExtension.js +2 -2
- package/dist/cjs/react/nodes/table/sticky.js +2 -2
- package/dist/cjs/react/nodes/tableCell.js +1 -39
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/marks/textColor.js +2 -40
- package/dist/es2019/react/nodes/blockCard.js +6 -5
- package/dist/es2019/react/nodes/embedCard.js +7 -2
- package/dist/es2019/react/nodes/inlineCard.js +3 -0
- package/dist/es2019/react/nodes/mediaSingle/index.js +1 -4
- package/dist/es2019/react/nodes/multiBodiedExtension.js +21 -4
- package/dist/es2019/react/nodes/table/sticky.js +2 -2
- package/dist/es2019/react/nodes/tableCell.js +2 -40
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/marks/textColor.js +2 -40
- package/dist/esm/react/nodes/blockCard.js +6 -5
- package/dist/esm/react/nodes/embedCard.js +12 -8
- package/dist/esm/react/nodes/inlineCard.js +3 -0
- package/dist/esm/react/nodes/mediaSingle/index.js +1 -4
- package/dist/esm/react/nodes/multiBodiedExtension.js +3 -3
- package/dist/esm/react/nodes/table/sticky.js +2 -2
- package/dist/esm/react/nodes/tableCell.js +2 -40
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/types/smartLinksOptions.d.ts +6 -0
- package/dist/types-ts4.5/types/smartLinksOptions.d.ts +6 -0
- package/package.json +4 -7
- package/tsconfig.json +1021 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#68535](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68535) [`9d9c89e4ff0c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d9c89e4ff0c) - Implement smart-card actionOptions prop within editor and expose prop to editor and renderer
|
|
8
|
+
- [#69296](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69296) [`de8513419971`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/de8513419971) - EDF-26 Cleaned up platform.editor.use-lch-for-color-inversion_1qv8ol feature flag. Text and table cell background colors now use the LCH inversion method by default.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [#69403](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69403) [`a0f886ed02f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a0f886ed02f4) - fix blurriness in images by reverting to using container width for media single
|
|
13
|
+
- [#68264](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68264) [`daa71f6aa162`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/daa71f6aa162) - [ux] ED-21883: Updated MultiBodied Extension related CSS and selections
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 109.2.7
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#67831](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67831) [`6027f6646d15`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6027f6646d15) - Fix table scroll when pressing CMD+A to select all
|
|
21
|
+
|
|
3
22
|
## 109.2.6
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -12,40 +12,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
14
14
|
var _tokens = require("@atlaskit/tokens");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
/**
|
|
19
|
-
* This function is duplicated in
|
|
20
|
-
* - @atlaskit/adf-schema
|
|
21
|
-
* - ../nodes/tableCell.tsx
|
|
22
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
|
23
|
-
* it will invert the color and return the inverted color.
|
|
24
|
-
*/
|
|
25
|
-
function invertCustomColor(customColor) {
|
|
26
|
-
var hex;
|
|
27
|
-
if ((0, _adfSchema.isHex)(customColor)) {
|
|
28
|
-
hex = customColor;
|
|
29
|
-
} else if ((0, _adfSchema.isRgb)(customColor)) {
|
|
30
|
-
hex = (0, _adfSchema.rgbToHex)(customColor);
|
|
31
|
-
if (hex === null) {
|
|
32
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
|
33
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
|
34
|
-
// to align with the rgbToHex function
|
|
35
|
-
return customColor;
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
return customColor;
|
|
39
|
-
}
|
|
40
|
-
var hexWithoutHash = hex.replace('#', '');
|
|
41
|
-
|
|
42
|
-
// This inverts the hex color by
|
|
43
|
-
// 1. converting the hex code to a number
|
|
44
|
-
// 2. XORing it with 0xffffff
|
|
45
|
-
// 3. Converting the result back to hex
|
|
46
|
-
// 4. Removing the leading 1 from the result
|
|
47
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
|
48
|
-
}
|
|
49
17
|
function TextColor(props) {
|
|
50
18
|
var _useThemeObserver = (0, _tokens.useThemeObserver)(),
|
|
51
19
|
colorMode = _useThemeObserver.colorMode;
|
|
@@ -77,12 +45,7 @@ function TextColor(props) {
|
|
|
77
45
|
} else {
|
|
78
46
|
if (colorMode === 'dark') {
|
|
79
47
|
// if we have a custom color, we need to check if we are in dark mode
|
|
80
|
-
|
|
81
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
|
82
|
-
paletteColorValue = (0, _adfSchema.getDarkModeLCHColor)(props.color);
|
|
83
|
-
} else {
|
|
84
|
-
paletteColorValue = invertCustomColor(props.color);
|
|
85
|
-
}
|
|
48
|
+
paletteColorValue = (0, _adfSchema.getDarkModeLCHColor)(props.color);
|
|
86
49
|
} else {
|
|
87
50
|
// if we are in light mode, we can just set the color
|
|
88
51
|
paletteColorValue = props.color;
|
|
@@ -36,7 +36,8 @@ function BlockCard(props) {
|
|
|
36
36
|
smartLinks = props.smartLinks,
|
|
37
37
|
isNodeNested = props.isNodeNested;
|
|
38
38
|
var _ref = smartLinks || {},
|
|
39
|
-
showServerActions = _ref.showServerActions
|
|
39
|
+
showServerActions = _ref.showServerActions,
|
|
40
|
+
actionOptions = _ref.actionOptions;
|
|
40
41
|
var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
|
|
41
42
|
var platform = (0, _react.useMemo)(function () {
|
|
42
43
|
return (0, _utils.getPlatform)(rendererAppearance);
|
|
@@ -46,7 +47,9 @@ function BlockCard(props) {
|
|
|
46
47
|
data: data,
|
|
47
48
|
onClick: onClick,
|
|
48
49
|
container: portal,
|
|
49
|
-
isDatasource: !!props.datasource
|
|
50
|
+
isDatasource: !!props.datasource,
|
|
51
|
+
actionOptions: actionOptions,
|
|
52
|
+
showServerActions: showServerActions
|
|
50
53
|
};
|
|
51
54
|
var analyticsData = {
|
|
52
55
|
attributes: {
|
|
@@ -123,9 +126,7 @@ function BlockCard(props) {
|
|
|
123
126
|
unsupportedComponent: _ui.UnsupportedBlock
|
|
124
127
|
}, cardProps), (0, _react2.jsx)(_smartCard.Card, (0, _extends2.default)({
|
|
125
128
|
appearance: "block",
|
|
126
|
-
|
|
127
|
-
platform: platform,
|
|
128
|
-
showServerActions: showServerActions
|
|
129
|
+
platform: platform
|
|
129
130
|
}, cardProps, {
|
|
130
131
|
onError: onError
|
|
131
132
|
})))));
|
|
@@ -37,6 +37,9 @@ function EmbedCard(props) {
|
|
|
37
37
|
smartLinks = props.smartLinks;
|
|
38
38
|
var embedIframeRef = (0, _react2.useRef)(null);
|
|
39
39
|
var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
|
|
40
|
+
var _ref = smartLinks || {},
|
|
41
|
+
showServerActions = _ref.showServerActions,
|
|
42
|
+
actionOptions = _ref.actionOptions;
|
|
40
43
|
var platform = (0, _react2.useMemo)(function () {
|
|
41
44
|
return (0, _utils.getPlatform)(rendererAppearance);
|
|
42
45
|
}, [rendererAppearance]);
|
|
@@ -46,8 +49,9 @@ function EmbedCard(props) {
|
|
|
46
49
|
onClick: onClick,
|
|
47
50
|
container: portal,
|
|
48
51
|
platform: platform,
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
frameStyle: (_smartLinks$frameStyl = smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle) !== null && _smartLinks$frameStyl !== void 0 ? _smartLinks$frameStyl : (0, _platformFeatureFlags.getBooleanFF)('platform.editor.show-embed-card-frame-renderer') ? 'show' : undefined,
|
|
53
|
+
actionOptions: actionOptions,
|
|
54
|
+
showServerActions: showServerActions
|
|
51
55
|
};
|
|
52
56
|
var _useState = (0, _react2.useState)(null),
|
|
53
57
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -87,8 +91,8 @@ function EmbedCard(props) {
|
|
|
87
91
|
hasPreview = _useState6[0],
|
|
88
92
|
setPreviewAvailableState = _useState6[1];
|
|
89
93
|
var cardContext = (0, _react2.useContext)(_linkProvider.SmartCardContext);
|
|
90
|
-
var onResolve = function onResolve(
|
|
91
|
-
var resolvedAspectRatio =
|
|
94
|
+
var onResolve = function onResolve(_ref2) {
|
|
95
|
+
var resolvedAspectRatio = _ref2.aspectRatio;
|
|
92
96
|
var hasPreviewOnResolve = !!(cardContext && url && cardContext.extractors.getPreview(url, platform));
|
|
93
97
|
if (!hasPreviewOnResolve) {
|
|
94
98
|
setPreviewAvailableState(false);
|
|
@@ -104,8 +108,8 @@ function EmbedCard(props) {
|
|
|
104
108
|
};
|
|
105
109
|
return (0, _react.jsx)(_analyticsNext.AnalyticsContext, {
|
|
106
110
|
data: analyticsData
|
|
107
|
-
}, (0, _react.jsx)(_ui.WidthConsumer, null, function (
|
|
108
|
-
var documentWidth =
|
|
111
|
+
}, (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref3) {
|
|
112
|
+
var documentWidth = _ref3.width;
|
|
109
113
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
110
114
|
var containerWidth = documentWidth;
|
|
111
115
|
if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && !containerWidth) {
|
|
@@ -123,8 +127,8 @@ function EmbedCard(props) {
|
|
|
123
127
|
}
|
|
124
128
|
var lineLength = isFullWidth ? Math.min(_editorSharedStyles.akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
125
129
|
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
|
|
126
|
-
var onError = function onError(
|
|
127
|
-
var err =
|
|
130
|
+
var onError = function onError(_ref4) {
|
|
131
|
+
var err = _ref4.err;
|
|
128
132
|
if (err) {
|
|
129
133
|
throw err;
|
|
130
134
|
}
|
|
@@ -31,6 +31,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
31
31
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
32
32
|
hideHoverPreview = _ref.hideHoverPreview,
|
|
33
33
|
showServerActions = _ref.showServerActions,
|
|
34
|
+
actionOptions = _ref.actionOptions,
|
|
34
35
|
ssr = _ref.ssr;
|
|
35
36
|
var analyticsData = {
|
|
36
37
|
attributes: {
|
|
@@ -47,6 +48,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
47
48
|
url: url,
|
|
48
49
|
showAuthTooltip: showAuthTooltip,
|
|
49
50
|
showHoverPreview: !hideHoverPreview,
|
|
51
|
+
actionOptions: actionOptions,
|
|
50
52
|
showServerActions: showServerActions,
|
|
51
53
|
onClick: onClick
|
|
52
54
|
}));
|
|
@@ -69,6 +71,7 @@ var InlineCard = function InlineCard(props) {
|
|
|
69
71
|
appearance: "inline",
|
|
70
72
|
showHoverPreview: !hideHoverPreview,
|
|
71
73
|
showAuthTooltip: showAuthTooltip,
|
|
74
|
+
actionOptions: actionOptions,
|
|
72
75
|
showServerActions: showServerActions
|
|
73
76
|
}, cardProps, {
|
|
74
77
|
onResolve: function onResolve(data) {
|
|
@@ -126,10 +126,7 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
126
126
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
127
127
|
var calcDimensions = function calcDimensions(mediaContainerWidth) {
|
|
128
128
|
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
// max width and height are already handled in mediaSingle
|
|
132
|
-
var maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
|
|
129
|
+
var maxWidth = containerWidth;
|
|
133
130
|
var maxHeight = height / width * maxWidth;
|
|
134
131
|
var cardDimensions = {
|
|
135
132
|
width: "".concat(maxWidth, "px"),
|
|
@@ -51,7 +51,7 @@ var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActions(_re
|
|
|
51
51
|
}, [updateActiveChild, children]);
|
|
52
52
|
return actions;
|
|
53
53
|
};
|
|
54
|
-
var navigationCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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
|
|
54
|
+
var navigationCSS = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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(_colors.N40, ")"));
|
|
55
55
|
var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
56
56
|
var children = props.children,
|
|
57
57
|
_props$layout = props.layout,
|
|
@@ -75,7 +75,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
75
75
|
updateActiveChild: updateActiveChild,
|
|
76
76
|
children: children
|
|
77
77
|
});
|
|
78
|
-
var containerCSS = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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(_colors.
|
|
78
|
+
var containerCSS = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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(_colors.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)");
|
|
79
79
|
var isTopLevel = path.length < 1;
|
|
80
80
|
var centerAlignClass = isTopLevel && ['wide', 'full-width'].includes(layout) ? _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN : '';
|
|
81
81
|
function renderMbeContent(width) {
|
|
@@ -34,7 +34,7 @@ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, r
|
|
|
34
34
|
} else {
|
|
35
35
|
stickyHeaderZIndex = _editorSharedStyles.akEditorStickyHeaderZIndex;
|
|
36
36
|
}
|
|
37
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n\n &.
|
|
37
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n tr {\n background: ", ";\n }\n }\n\n border-top: ", "px solid\n ", ";\n background: ", ";\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".is-sticky.right-shadow::after,\n &\n .", ".is-sticky.left-shadow::before {\n top: 0px;\n height: 100%;\n }\n\n &.fixed-table-div-custom-table-resizing[mode='stick'] {\n z-index: ", ";\n }\n "])), typeof top === 'number' && "top: ".concat(top, "px;"), width, stickyHeaderZIndex, _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, "var(--ds-surface, white)", tableStickyPadding, "var(--ds-surface, white)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER, stickyHeaderZIndex);
|
|
38
38
|
};
|
|
39
39
|
var FixedTableDiv = exports.FixedTableDiv = function FixedTableDiv(props) {
|
|
40
40
|
var top = props.top,
|
|
@@ -47,7 +47,7 @@ var FixedTableDiv = exports.FixedTableDiv = function FixedTableDiv(props) {
|
|
|
47
47
|
};
|
|
48
48
|
return (0, _react2.jsx)("div", (0, _extends2.default)({}, attrs, {
|
|
49
49
|
"data-testid": "sticky-table-fixed",
|
|
50
|
-
className: (0, _table2.isTableResizingEnabled)(rendererAppearance) ? '
|
|
50
|
+
className: (0, _table2.isTableResizingEnabled)(rendererAppearance) ? 'fixed-table-div-custom-table-resizing' : '',
|
|
51
51
|
css: fixedTableCss
|
|
52
52
|
}), props.children);
|
|
53
53
|
};
|
|
@@ -17,7 +17,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
17
17
|
var _consts = require("../../consts");
|
|
18
18
|
var _reactIntlNext = require("react-intl-next");
|
|
19
19
|
var _messages = require("../../messages");
|
|
20
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
20
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
22
21
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
23
22
|
switch (currentSortOrder) {
|
|
@@ -69,38 +68,6 @@ var getDataAttributes = function getDataAttributes(colwidth, background) {
|
|
|
69
68
|
}
|
|
70
69
|
return attrs;
|
|
71
70
|
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* This function is duplicated in
|
|
75
|
-
* - @atlaskit/adf-schema
|
|
76
|
-
* - ../marks/textColor.tsx
|
|
77
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
|
78
|
-
* it will invert the color and return the inverted color.
|
|
79
|
-
*/
|
|
80
|
-
function invertCustomColor(customColor) {
|
|
81
|
-
var hex;
|
|
82
|
-
if ((0, _adfSchema.isHex)(customColor)) {
|
|
83
|
-
hex = customColor;
|
|
84
|
-
} else if ((0, _adfSchema.isRgb)(customColor)) {
|
|
85
|
-
hex = (0, _adfSchema.rgbToHex)(customColor);
|
|
86
|
-
if (hex === null) {
|
|
87
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
|
88
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
|
89
|
-
// to align with the rgbToHex function
|
|
90
|
-
return customColor;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
return customColor;
|
|
94
|
-
}
|
|
95
|
-
var hexWithoutHash = hex.replace('#', '');
|
|
96
|
-
|
|
97
|
-
// This inverts the hex color by
|
|
98
|
-
// 1. converting the hex code to a number
|
|
99
|
-
// 2. XORing it with 0xffffff
|
|
100
|
-
// 3. Converting the result back to hex
|
|
101
|
-
// 4. Removing the leading 1 from the result
|
|
102
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
|
103
|
-
}
|
|
104
71
|
var getStyle = function getStyle(_ref) {
|
|
105
72
|
var background = _ref.background,
|
|
106
73
|
colGroupWidth = _ref.colGroupWidth,
|
|
@@ -134,12 +101,7 @@ var getStyle = function getStyle(_ref) {
|
|
|
134
101
|
// if we have a custom color, we need to check if we are in dark mode
|
|
135
102
|
if (colorMode === 'dark') {
|
|
136
103
|
// if we are in dark mode, we need to invert the color
|
|
137
|
-
|
|
138
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
|
139
|
-
style.backgroundColor = (0, _adfSchema.getDarkModeLCHColor)(background);
|
|
140
|
-
} else {
|
|
141
|
-
style.backgroundColor = invertCustomColor(background);
|
|
142
|
-
}
|
|
104
|
+
style.backgroundColor = (0, _adfSchema.getDarkModeLCHColor)(background);
|
|
143
105
|
} else {
|
|
144
106
|
// if we are in light mode, we can just set the color
|
|
145
107
|
style.backgroundColor = background;
|
|
@@ -54,7 +54,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
54
54
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
var packageName = "@atlaskit/renderer";
|
|
57
|
-
var packageVersion = "109.
|
|
57
|
+
var packageVersion = "109.3.0";
|
|
58
58
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
59
59
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
60
60
|
var _super = _createSuper(Renderer);
|
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { getDarkModeLCHColor } from '@atlaskit/adf-schema';
|
|
4
4
|
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
5
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This function is duplicated in
|
|
10
|
-
* - @atlaskit/adf-schema
|
|
11
|
-
* - ../nodes/tableCell.tsx
|
|
12
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
|
13
|
-
* it will invert the color and return the inverted color.
|
|
14
|
-
*/
|
|
15
|
-
function invertCustomColor(customColor) {
|
|
16
|
-
let hex;
|
|
17
|
-
if (isHex(customColor)) {
|
|
18
|
-
hex = customColor;
|
|
19
|
-
} else if (isRgb(customColor)) {
|
|
20
|
-
hex = rgbToHex(customColor);
|
|
21
|
-
if (hex === null) {
|
|
22
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
|
23
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
|
24
|
-
// to align with the rgbToHex function
|
|
25
|
-
return customColor;
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
return customColor;
|
|
29
|
-
}
|
|
30
|
-
const hexWithoutHash = hex.replace('#', '');
|
|
31
|
-
|
|
32
|
-
// This inverts the hex color by
|
|
33
|
-
// 1. converting the hex code to a number
|
|
34
|
-
// 2. XORing it with 0xffffff
|
|
35
|
-
// 3. Converting the result back to hex
|
|
36
|
-
// 4. Removing the leading 1 from the result
|
|
37
|
-
return `#${(Number(`0x1${hexWithoutHash}`) ^ 0xffffff).toString(16).substring(1).toUpperCase()}`;
|
|
38
|
-
}
|
|
39
6
|
export default function TextColor(props) {
|
|
40
7
|
const {
|
|
41
8
|
colorMode
|
|
@@ -68,12 +35,7 @@ export default function TextColor(props) {
|
|
|
68
35
|
} else {
|
|
69
36
|
if (colorMode === 'dark') {
|
|
70
37
|
// if we have a custom color, we need to check if we are in dark mode
|
|
71
|
-
|
|
72
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
|
73
|
-
paletteColorValue = getDarkModeLCHColor(props.color);
|
|
74
|
-
} else {
|
|
75
|
-
paletteColorValue = invertCustomColor(props.color);
|
|
76
|
-
}
|
|
38
|
+
paletteColorValue = getDarkModeLCHColor(props.color);
|
|
77
39
|
} else {
|
|
78
40
|
// if we are in light mode, we can just set the color
|
|
79
41
|
paletteColorValue = props.color;
|
|
@@ -31,7 +31,8 @@ export default function BlockCard(props) {
|
|
|
31
31
|
isNodeNested
|
|
32
32
|
} = props;
|
|
33
33
|
const {
|
|
34
|
-
showServerActions
|
|
34
|
+
showServerActions,
|
|
35
|
+
actionOptions
|
|
35
36
|
} = smartLinks || {};
|
|
36
37
|
const onClick = getCardClickHandler(eventHandlers, url);
|
|
37
38
|
const platform = useMemo(() => getPlatform(rendererAppearance), [rendererAppearance]);
|
|
@@ -40,7 +41,9 @@ export default function BlockCard(props) {
|
|
|
40
41
|
data,
|
|
41
42
|
onClick,
|
|
42
43
|
container: portal,
|
|
43
|
-
isDatasource: !!props.datasource
|
|
44
|
+
isDatasource: !!props.datasource,
|
|
45
|
+
actionOptions,
|
|
46
|
+
showServerActions
|
|
44
47
|
};
|
|
45
48
|
const analyticsData = {
|
|
46
49
|
attributes: {
|
|
@@ -113,9 +116,7 @@ export default function BlockCard(props) {
|
|
|
113
116
|
unsupportedComponent: UnsupportedBlock
|
|
114
117
|
}, cardProps), jsx(Card, _extends({
|
|
115
118
|
appearance: "block",
|
|
116
|
-
|
|
117
|
-
platform: platform,
|
|
118
|
-
showServerActions: showServerActions
|
|
119
|
+
platform: platform
|
|
119
120
|
}, cardProps, {
|
|
120
121
|
onError: onError
|
|
121
122
|
})))));
|
|
@@ -45,6 +45,10 @@ export default function EmbedCard(props) {
|
|
|
45
45
|
} = props;
|
|
46
46
|
const embedIframeRef = useRef(null);
|
|
47
47
|
const onClick = getCardClickHandler(eventHandlers, url);
|
|
48
|
+
const {
|
|
49
|
+
showServerActions,
|
|
50
|
+
actionOptions
|
|
51
|
+
} = smartLinks || {};
|
|
48
52
|
const platform = useMemo(() => getPlatform(rendererAppearance), [rendererAppearance]);
|
|
49
53
|
const cardProps = {
|
|
50
54
|
url,
|
|
@@ -52,8 +56,9 @@ export default function EmbedCard(props) {
|
|
|
52
56
|
onClick,
|
|
53
57
|
container: portal,
|
|
54
58
|
platform,
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
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,
|
|
60
|
+
actionOptions,
|
|
61
|
+
showServerActions
|
|
57
62
|
};
|
|
58
63
|
const [liveHeight, setLiveHeight] = useState(null);
|
|
59
64
|
const [aspectRatio, setAspectRatio] = useState();
|
|
@@ -26,6 +26,7 @@ const InlineCard = props => {
|
|
|
26
26
|
showAuthTooltip,
|
|
27
27
|
hideHoverPreview,
|
|
28
28
|
showServerActions,
|
|
29
|
+
actionOptions,
|
|
29
30
|
ssr
|
|
30
31
|
} = smartLinks || {};
|
|
31
32
|
const analyticsData = {
|
|
@@ -43,6 +44,7 @@ const InlineCard = props => {
|
|
|
43
44
|
url: url,
|
|
44
45
|
showAuthTooltip: showAuthTooltip,
|
|
45
46
|
showHoverPreview: !hideHoverPreview,
|
|
47
|
+
actionOptions: actionOptions,
|
|
46
48
|
showServerActions: showServerActions,
|
|
47
49
|
onClick: onClick
|
|
48
50
|
}));
|
|
@@ -66,6 +68,7 @@ const InlineCard = props => {
|
|
|
66
68
|
appearance: "inline",
|
|
67
69
|
showHoverPreview: !hideHoverPreview,
|
|
68
70
|
showAuthTooltip: showAuthTooltip,
|
|
71
|
+
actionOptions: actionOptions,
|
|
69
72
|
showServerActions: showServerActions
|
|
70
73
|
}, cardProps, {
|
|
71
74
|
onResolve: data => {
|
|
@@ -111,10 +111,7 @@ const MediaSingle = props => {
|
|
|
111
111
|
const isFullWidth = rendererAppearance === 'full-width';
|
|
112
112
|
const calcDimensions = mediaContainerWidth => {
|
|
113
113
|
const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
// max width and height are already handled in mediaSingle
|
|
117
|
-
const maxWidth = isPixel && widthAttr ? widthAttr : containerWidth;
|
|
114
|
+
const maxWidth = containerWidth;
|
|
118
115
|
const maxHeight = height / width * maxWidth;
|
|
119
116
|
const cardDimensions = {
|
|
120
117
|
width: `${maxWidth}px`,
|
|
@@ -6,7 +6,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-duplicate-imports
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import {
|
|
9
|
+
import { N30, N40 } from '@atlaskit/theme/colors';
|
|
10
10
|
import React, { useState } from 'react';
|
|
11
11
|
import { renderExtension } from './extension';
|
|
12
12
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
@@ -47,8 +47,7 @@ const navigationCSS = css`
|
|
|
47
47
|
user-select: none;
|
|
48
48
|
-webkit-user-modify: read-only;
|
|
49
49
|
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
border-bottom: none;
|
|
52
51
|
.mbe-add-tab-button,
|
|
53
52
|
.mbe-remove-tab {
|
|
54
53
|
display: none;
|
|
@@ -75,7 +74,14 @@ const MultiBodiedExtension = props => {
|
|
|
75
74
|
children
|
|
76
75
|
});
|
|
77
76
|
const containerCSS = css`
|
|
77
|
+
padding: 0;
|
|
78
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
79
|
+
position: relative;
|
|
80
|
+
vertical-align: middle;
|
|
78
81
|
min-height: 100px;
|
|
82
|
+
.ak-renderer-extension {
|
|
83
|
+
margin-top: 0 !important;
|
|
84
|
+
}
|
|
79
85
|
|
|
80
86
|
.multiBodiedExtension--frames > [data-extension-frame='true'] {
|
|
81
87
|
display: none;
|
|
@@ -83,9 +89,20 @@ const MultiBodiedExtension = props => {
|
|
|
83
89
|
|
|
84
90
|
.multiBodiedExtension--frames
|
|
85
91
|
> [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) {
|
|
86
|
-
|
|
92
|
+
padding: ${"var(--ds-space-100, 8px)"} !important;
|
|
93
|
+
border: 1px solid ${`var(--ds-border, ${N30})`};
|
|
87
94
|
display: block;
|
|
88
95
|
min-height: 100px;
|
|
96
|
+
background: ${"var(--ds-surface, white)"};
|
|
97
|
+
padding-left: ${"var(--ds-space-100, 8px)"};
|
|
98
|
+
padding-right: ${"var(--ds-space-100, 8px)"};
|
|
99
|
+
|
|
100
|
+
.bodiedExtensionView-content-wrap {
|
|
101
|
+
margin-top: ${"var(--ds-space-150, 12px)"} !important;
|
|
102
|
+
}
|
|
103
|
+
.extensionView-content-wrap {
|
|
104
|
+
margin-top: ${"var(--ds-space-150, 12px)"} !important;
|
|
105
|
+
}
|
|
89
106
|
}
|
|
90
107
|
`;
|
|
91
108
|
const isTopLevel = path.length < 1;
|
|
@@ -62,7 +62,7 @@ const fixedTableDivStaticStyles = (top, width, rendererAppearance) => {
|
|
|
62
62
|
height: 100%;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
&.
|
|
65
|
+
&.fixed-table-div-custom-table-resizing[mode='stick'] {
|
|
66
66
|
z-index: ${stickyHeaderZIndex};
|
|
67
67
|
}
|
|
68
68
|
`;
|
|
@@ -80,7 +80,7 @@ export const FixedTableDiv = props => {
|
|
|
80
80
|
};
|
|
81
81
|
return jsx("div", _extends({}, attrs, {
|
|
82
82
|
"data-testid": "sticky-table-fixed",
|
|
83
|
-
className: isTableResizingEnabled(rendererAppearance) ? '
|
|
83
|
+
className: isTableResizingEnabled(rendererAppearance) ? 'fixed-table-div-custom-table-resizing' : '',
|
|
84
84
|
css: fixedTableCss
|
|
85
85
|
}), props.children);
|
|
86
86
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
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
|
const IgnoreSorting = ['LABEL', 'INPUT'];
|
|
15
14
|
const nextStatusOrder = currentSortOrder => {
|
|
16
15
|
switch (currentSortOrder) {
|
|
@@ -64,38 +63,6 @@ const getDataAttributes = (colwidth, background) => {
|
|
|
64
63
|
}
|
|
65
64
|
return attrs;
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* This function is duplicated in
|
|
70
|
-
* - @atlaskit/adf-schema
|
|
71
|
-
* - ../marks/textColor.tsx
|
|
72
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
|
73
|
-
* it will invert the color and return the inverted color.
|
|
74
|
-
*/
|
|
75
|
-
function invertCustomColor(customColor) {
|
|
76
|
-
let hex;
|
|
77
|
-
if (isHex(customColor)) {
|
|
78
|
-
hex = customColor;
|
|
79
|
-
} else if (isRgb(customColor)) {
|
|
80
|
-
hex = rgbToHex(customColor);
|
|
81
|
-
if (hex === null) {
|
|
82
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
|
83
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
|
84
|
-
// to align with the rgbToHex function
|
|
85
|
-
return customColor;
|
|
86
|
-
}
|
|
87
|
-
} else {
|
|
88
|
-
return customColor;
|
|
89
|
-
}
|
|
90
|
-
const hexWithoutHash = hex.replace('#', '');
|
|
91
|
-
|
|
92
|
-
// This inverts the hex color by
|
|
93
|
-
// 1. converting the hex code to a number
|
|
94
|
-
// 2. XORing it with 0xffffff
|
|
95
|
-
// 3. Converting the result back to hex
|
|
96
|
-
// 4. Removing the leading 1 from the result
|
|
97
|
-
return `#${(Number(`0x1${hexWithoutHash}`) ^ 0xffffff).toString(16).substring(1).toUpperCase()}`;
|
|
98
|
-
}
|
|
99
66
|
const getStyle = ({
|
|
100
67
|
background,
|
|
101
68
|
colGroupWidth,
|
|
@@ -130,12 +97,7 @@ const getStyle = ({
|
|
|
130
97
|
// if we have a custom color, we need to check if we are in dark mode
|
|
131
98
|
if (colorMode === 'dark') {
|
|
132
99
|
// if we are in dark mode, we need to invert the color
|
|
133
|
-
|
|
134
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
|
135
|
-
style.backgroundColor = getDarkModeLCHColor(background);
|
|
136
|
-
} else {
|
|
137
|
-
style.backgroundColor = invertCustomColor(background);
|
|
138
|
-
}
|
|
100
|
+
style.backgroundColor = getDarkModeLCHColor(background);
|
|
139
101
|
} else {
|
|
140
102
|
// if we are in light mode, we can just set the color
|
|
141
103
|
style.backgroundColor = background;
|
|
@@ -35,7 +35,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "109.
|
|
38
|
+
const packageVersion = "109.3.0";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|