@atlaskit/renderer 109.1.3 → 109.1.5
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 +13 -0
- package/dist/cjs/react/index.js +10 -0
- package/dist/cjs/react/nodes/blockCard.js +4 -2
- package/dist/cjs/react/nodes/embedCard.js +3 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/index.js +8 -0
- package/dist/es2019/react/nodes/blockCard.js +4 -2
- package/dist/es2019/react/nodes/embedCard.js +3 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/index.js +10 -0
- package/dist/esm/react/nodes/blockCard.js +4 -2
- package/dist/esm/react/nodes/embedCard.js +3 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/nodes/blockCard.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +1 -0
- package/dist/types-ts4.5/react/index.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/blockCard.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/index.d.ts +1 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#63612](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63612) [`ce40b4308ec7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce40b4308ec7) - Fix an issue with datasource table where rendering inside another component causes it to overflow beyound the parent component.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 109.1.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#63354](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63354) [`0b49755d1170`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0b49755d1170) - [ux] Include embed card frame as part of its width when frameStyle is set to "show" and show embed frame by default in renderer
|
|
15
|
+
|
|
3
16
|
## 109.1.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -219,6 +219,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
219
219
|
return this.getTaskItemProps(node, path);
|
|
220
220
|
case 'embedCard':
|
|
221
221
|
return this.getEmbedCardProps(node, path);
|
|
222
|
+
case 'blockCard':
|
|
223
|
+
return this.getBlockCardProps(node, path);
|
|
222
224
|
case 'expand':
|
|
223
225
|
return this.getExpandProps(node, path);
|
|
224
226
|
case 'unsupportedBlock':
|
|
@@ -424,6 +426,14 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
424
426
|
isInsideOfBlockNode: isInsideOfBlockNode
|
|
425
427
|
});
|
|
426
428
|
}
|
|
429
|
+
}, {
|
|
430
|
+
key: "getBlockCardProps",
|
|
431
|
+
value: function getBlockCardProps(node) {
|
|
432
|
+
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
433
|
+
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
434
|
+
isNodeNested: path.length > 0
|
|
435
|
+
});
|
|
436
|
+
}
|
|
427
437
|
}, {
|
|
428
438
|
key: "getMediaGroupProps",
|
|
429
439
|
value: function getMediaGroupProps(node) {
|
|
@@ -33,7 +33,8 @@ function BlockCard(props) {
|
|
|
33
33
|
eventHandlers = props.eventHandlers,
|
|
34
34
|
portal = props.portal,
|
|
35
35
|
rendererAppearance = props.rendererAppearance,
|
|
36
|
-
smartLinks = props.smartLinks
|
|
36
|
+
smartLinks = props.smartLinks,
|
|
37
|
+
isNodeNested = props.isNodeNested;
|
|
37
38
|
var _ref = smartLinks || {},
|
|
38
39
|
showServerActions = _ref.showServerActions;
|
|
39
40
|
var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
|
|
@@ -93,8 +94,9 @@ function BlockCard(props) {
|
|
|
93
94
|
var width = _ref5.width;
|
|
94
95
|
return (0, _react2.jsx)("div", {
|
|
95
96
|
css: datasourceContainerStyle,
|
|
97
|
+
"data-testid": "renderer-datasource-table",
|
|
96
98
|
style: {
|
|
97
|
-
width: (0, _utils2.calcBreakoutWidth)(layout, width)
|
|
99
|
+
width: isNodeNested ? '100%' : (0, _utils2.calcBreakoutWidth)(layout, width)
|
|
98
100
|
}
|
|
99
101
|
}, (0, _react2.jsx)(_linkDatasource.DatasourceTableView, {
|
|
100
102
|
datasourceId: datasource.id,
|
|
@@ -12,6 +12,7 @@ var _react = require("@emotion/react");
|
|
|
12
12
|
var _react2 = require("react");
|
|
13
13
|
var _smartCard = require("@atlaskit/smart-card");
|
|
14
14
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
18
|
var _utils = require("../../utils");
|
|
@@ -24,6 +25,7 @@ var _templateObject, _templateObject2;
|
|
|
24
25
|
var embedCardWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
|
|
25
26
|
var uIMediaSingleLayoutStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
26
27
|
function EmbedCard(props) {
|
|
28
|
+
var _smartLinks$frameStyl;
|
|
27
29
|
var url = props.url,
|
|
28
30
|
data = props.data,
|
|
29
31
|
eventHandlers = props.eventHandlers,
|
|
@@ -45,7 +47,7 @@ function EmbedCard(props) {
|
|
|
45
47
|
container: portal,
|
|
46
48
|
platform: platform,
|
|
47
49
|
showActions: platform === 'web',
|
|
48
|
-
frameStyle: smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle
|
|
50
|
+
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
|
|
49
51
|
};
|
|
50
52
|
var _useState = (0, _react2.useState)(null),
|
|
51
53
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -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.1.
|
|
57
|
+
var packageVersion = "109.1.5";
|
|
58
58
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
59
59
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
60
60
|
var _super = _createSuper(Renderer);
|
|
@@ -200,6 +200,8 @@ export default class ReactSerializer {
|
|
|
200
200
|
return this.getTaskItemProps(node, path);
|
|
201
201
|
case 'embedCard':
|
|
202
202
|
return this.getEmbedCardProps(node, path);
|
|
203
|
+
case 'blockCard':
|
|
204
|
+
return this.getBlockCardProps(node, path);
|
|
203
205
|
case 'expand':
|
|
204
206
|
return this.getExpandProps(node, path);
|
|
205
207
|
case 'unsupportedBlock':
|
|
@@ -371,6 +373,12 @@ export default class ReactSerializer {
|
|
|
371
373
|
isInsideOfBlockNode
|
|
372
374
|
};
|
|
373
375
|
}
|
|
376
|
+
getBlockCardProps(node, path = []) {
|
|
377
|
+
return {
|
|
378
|
+
...this.getProps(node),
|
|
379
|
+
isNodeNested: path.length > 0
|
|
380
|
+
};
|
|
381
|
+
}
|
|
374
382
|
getMediaGroupProps(node) {
|
|
375
383
|
var _this$media2, _this$media3;
|
|
376
384
|
return {
|
|
@@ -27,7 +27,8 @@ export default function BlockCard(props) {
|
|
|
27
27
|
eventHandlers,
|
|
28
28
|
portal,
|
|
29
29
|
rendererAppearance,
|
|
30
|
-
smartLinks
|
|
30
|
+
smartLinks,
|
|
31
|
+
isNodeNested
|
|
31
32
|
} = props;
|
|
32
33
|
const {
|
|
33
34
|
showServerActions
|
|
@@ -84,8 +85,9 @@ export default function BlockCard(props) {
|
|
|
84
85
|
width
|
|
85
86
|
}) => jsx("div", {
|
|
86
87
|
css: datasourceContainerStyle,
|
|
88
|
+
"data-testid": "renderer-datasource-table",
|
|
87
89
|
style: {
|
|
88
|
-
width: calcBreakoutWidth(layout, width)
|
|
90
|
+
width: isNodeNested ? '100%' : calcBreakoutWidth(layout, width)
|
|
89
91
|
}
|
|
90
92
|
}, jsx(DatasourceTableView, {
|
|
91
93
|
datasourceId: datasource.id,
|
|
@@ -4,6 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
5
5
|
import { Card, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
6
6
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { WidthConsumer, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
8
9
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import { getPlatform } from '../../utils';
|
|
@@ -30,6 +31,7 @@ const uIMediaSingleLayoutStyles = css`
|
|
|
30
31
|
transform: translateX(-50%);
|
|
31
32
|
`;
|
|
32
33
|
export default function EmbedCard(props) {
|
|
34
|
+
var _smartLinks$frameStyl;
|
|
33
35
|
const {
|
|
34
36
|
url,
|
|
35
37
|
data,
|
|
@@ -51,7 +53,7 @@ export default function EmbedCard(props) {
|
|
|
51
53
|
container: portal,
|
|
52
54
|
platform,
|
|
53
55
|
showActions: platform === 'web',
|
|
54
|
-
frameStyle: smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle
|
|
56
|
+
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
|
|
55
57
|
};
|
|
56
58
|
const [liveHeight, setLiveHeight] = useState(null);
|
|
57
59
|
const [aspectRatio, setAspectRatio] = useState();
|
|
@@ -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.1.
|
|
38
|
+
const packageVersion = "109.1.5";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
package/dist/esm/react/index.js
CHANGED
|
@@ -212,6 +212,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
212
212
|
return this.getTaskItemProps(node, path);
|
|
213
213
|
case 'embedCard':
|
|
214
214
|
return this.getEmbedCardProps(node, path);
|
|
215
|
+
case 'blockCard':
|
|
216
|
+
return this.getBlockCardProps(node, path);
|
|
215
217
|
case 'expand':
|
|
216
218
|
return this.getExpandProps(node, path);
|
|
217
219
|
case 'unsupportedBlock':
|
|
@@ -417,6 +419,14 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
417
419
|
isInsideOfBlockNode: isInsideOfBlockNode
|
|
418
420
|
});
|
|
419
421
|
}
|
|
422
|
+
}, {
|
|
423
|
+
key: "getBlockCardProps",
|
|
424
|
+
value: function getBlockCardProps(node) {
|
|
425
|
+
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
426
|
+
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
427
|
+
isNodeNested: path.length > 0
|
|
428
|
+
});
|
|
429
|
+
}
|
|
420
430
|
}, {
|
|
421
431
|
key: "getMediaGroupProps",
|
|
422
432
|
value: function getMediaGroupProps(node) {
|
|
@@ -26,7 +26,8 @@ export default function BlockCard(props) {
|
|
|
26
26
|
eventHandlers = props.eventHandlers,
|
|
27
27
|
portal = props.portal,
|
|
28
28
|
rendererAppearance = props.rendererAppearance,
|
|
29
|
-
smartLinks = props.smartLinks
|
|
29
|
+
smartLinks = props.smartLinks,
|
|
30
|
+
isNodeNested = props.isNodeNested;
|
|
30
31
|
var _ref = smartLinks || {},
|
|
31
32
|
showServerActions = _ref.showServerActions;
|
|
32
33
|
var onClick = getCardClickHandler(eventHandlers, url);
|
|
@@ -86,8 +87,9 @@ export default function BlockCard(props) {
|
|
|
86
87
|
var width = _ref5.width;
|
|
87
88
|
return jsx("div", {
|
|
88
89
|
css: datasourceContainerStyle,
|
|
90
|
+
"data-testid": "renderer-datasource-table",
|
|
89
91
|
style: {
|
|
90
|
-
width: calcBreakoutWidth(layout, width)
|
|
92
|
+
width: isNodeNested ? '100%' : calcBreakoutWidth(layout, width)
|
|
91
93
|
}
|
|
92
94
|
}, jsx(DatasourceTableView, {
|
|
93
95
|
datasourceId: datasource.id,
|
|
@@ -7,6 +7,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
8
8
|
import { Card, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
9
9
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { WidthConsumer, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
11
12
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
12
13
|
import { getPlatform } from '../../utils';
|
|
@@ -17,6 +18,7 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
|
17
18
|
var embedCardWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
|
|
18
19
|
var uIMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
19
20
|
export default function EmbedCard(props) {
|
|
21
|
+
var _smartLinks$frameStyl;
|
|
20
22
|
var url = props.url,
|
|
21
23
|
data = props.data,
|
|
22
24
|
eventHandlers = props.eventHandlers,
|
|
@@ -38,7 +40,7 @@ export default function EmbedCard(props) {
|
|
|
38
40
|
container: portal,
|
|
39
41
|
platform: platform,
|
|
40
42
|
showActions: platform === 'web',
|
|
41
|
-
frameStyle: smartLinks === null || smartLinks === void 0 ? void 0 : smartLinks.frameStyle
|
|
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
|
|
42
44
|
};
|
|
43
45
|
var _useState = useState(null),
|
|
44
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -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.1.
|
|
48
|
+
var packageVersion = "109.1.5";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -101,6 +101,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
101
101
|
private getMediaProps;
|
|
102
102
|
private getEmojiProps;
|
|
103
103
|
private getEmbedCardProps;
|
|
104
|
+
private getBlockCardProps;
|
|
104
105
|
private getMediaGroupProps;
|
|
105
106
|
private getMediaInlineProps;
|
|
106
107
|
private getTaskItemProps;
|
|
@@ -61,6 +61,7 @@ declare const BlockCard: React.ComponentType<{
|
|
|
61
61
|
rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
|
|
62
62
|
smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
|
|
63
63
|
layout?: string | undefined;
|
|
64
|
+
isNodeNested?: boolean | undefined;
|
|
64
65
|
}> & Loadable.LoadableComponent;
|
|
65
66
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
66
67
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
|
@@ -101,6 +101,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
101
101
|
private getMediaProps;
|
|
102
102
|
private getEmojiProps;
|
|
103
103
|
private getEmbedCardProps;
|
|
104
|
+
private getBlockCardProps;
|
|
104
105
|
private getMediaGroupProps;
|
|
105
106
|
private getMediaInlineProps;
|
|
106
107
|
private getTaskItemProps;
|
|
@@ -61,6 +61,7 @@ declare const BlockCard: React.ComponentType<{
|
|
|
61
61
|
rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
|
|
62
62
|
smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
|
|
63
63
|
layout?: string | undefined;
|
|
64
|
+
isNodeNested?: boolean | undefined;
|
|
64
65
|
}> & Loadable.LoadableComponent;
|
|
65
66
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
66
67
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.1.
|
|
3
|
+
"version": "109.1.5",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
33
33
|
"@atlaskit/button": "^17.1.0",
|
|
34
34
|
"@atlaskit/code": "^15.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^76.
|
|
35
|
+
"@atlaskit/editor-common": "^76.31.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",
|
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
},
|
|
132
132
|
"platform.editor.use-lch-for-color-inversion_1qv8ol": {
|
|
133
133
|
"type": "boolean"
|
|
134
|
+
},
|
|
135
|
+
"platform.editor.show-embed-card-frame-renderer": {
|
|
136
|
+
"type": "boolean"
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
}
|