@atlaskit/renderer 124.18.0 → 124.20.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 +22 -0
- package/afm-cc/tsconfig.json +6 -0
- package/afm-jira/tsconfig.json +6 -0
- package/afm-products/tsconfig.json +6 -0
- package/dist/cjs/react/nodes/extension.js +26 -10
- package/dist/cjs/react/nodes/extensionFrame.js +2 -7
- package/dist/cjs/react/nodes/index.js +1 -2
- package/dist/cjs/react/nodes/multiBodiedExtension/actions.js +2 -0
- package/dist/cjs/react/nodes/multiBodiedExtension.js +2 -2
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/extension.js +23 -8
- package/dist/es2019/react/nodes/extensionFrame.js +2 -7
- package/dist/es2019/react/nodes/index.js +1 -2
- package/dist/es2019/react/nodes/multiBodiedExtension/actions.js +2 -0
- package/dist/es2019/react/nodes/multiBodiedExtension.js +2 -2
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/extension.js +23 -8
- package/dist/esm/react/nodes/extensionFrame.js +2 -7
- package/dist/esm/react/nodes/index.js +1 -2
- package/dist/esm/react/nodes/multiBodiedExtension/actions.js +2 -0
- package/dist/esm/react/nodes/multiBodiedExtension.js +2 -2
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/analytics/events.d.ts +4 -1
- package/dist/types/react/nodes/extension.d.ts +4 -0
- package/dist/types/ui/annotations/element/mark.d.ts +12 -12
- package/dist/types-ts4.5/analytics/events.d.ts +4 -1
- package/dist/types-ts4.5/react/nodes/extension.d.ts +4 -0
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +12 -12
- package/package.json +11 -11
- package/dist/cjs/react/nodes/multiBodiedExtensionOld.js +0 -156
- package/dist/es2019/react/nodes/multiBodiedExtensionOld.js +0 -168
- package/dist/esm/react/nodes/multiBodiedExtensionOld.js +0 -148
- package/dist/types/react/nodes/multiBodiedExtensionOld.d.ts +0 -29
- package/dist/types-ts4.5/react/nodes/multiBodiedExtensionOld.d.ts +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 124.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ffb6f2957dccf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ffb6f2957dccf) -
|
|
8
|
+
fg clean up: platform_editor_multi_body_extension_extensibility
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 124.19.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`5f95a3d8edc0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f95a3d8edc0c) -
|
|
19
|
+
EDITOR-3356 fix macro renderer syle inside layout
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 124.18.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"../src/**/stories/**/*"
|
|
25
25
|
],
|
|
26
26
|
"references": [
|
|
27
|
+
{
|
|
28
|
+
"path": "../../adf-schema/afm-cc/tsconfig.json"
|
|
29
|
+
},
|
|
27
30
|
{
|
|
28
31
|
"path": "../../adf-utils/afm-cc/tsconfig.json"
|
|
29
32
|
},
|
|
@@ -51,6 +54,9 @@
|
|
|
51
54
|
{
|
|
52
55
|
"path": "../../editor-palette/afm-cc/tsconfig.json"
|
|
53
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"path": "../../editor-prosemirror/afm-cc/tsconfig.json"
|
|
59
|
+
},
|
|
54
60
|
{
|
|
55
61
|
"path": "../../editor-shared-styles/afm-cc/tsconfig.json"
|
|
56
62
|
},
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"../src/**/stories/**/*"
|
|
25
25
|
],
|
|
26
26
|
"references": [
|
|
27
|
+
{
|
|
28
|
+
"path": "../../adf-schema/afm-jira/tsconfig.json"
|
|
29
|
+
},
|
|
27
30
|
{
|
|
28
31
|
"path": "../../adf-utils/afm-jira/tsconfig.json"
|
|
29
32
|
},
|
|
@@ -51,6 +54,9 @@
|
|
|
51
54
|
{
|
|
52
55
|
"path": "../../editor-palette/afm-jira/tsconfig.json"
|
|
53
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"path": "../../editor-prosemirror/afm-jira/tsconfig.json"
|
|
59
|
+
},
|
|
54
60
|
{
|
|
55
61
|
"path": "../../editor-shared-styles/afm-jira/tsconfig.json"
|
|
56
62
|
},
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"../src/**/stories/**/*"
|
|
25
25
|
],
|
|
26
26
|
"references": [
|
|
27
|
+
{
|
|
28
|
+
"path": "../../adf-schema/afm-products/tsconfig.json"
|
|
29
|
+
},
|
|
27
30
|
{
|
|
28
31
|
"path": "../../adf-utils/afm-products/tsconfig.json"
|
|
29
32
|
},
|
|
@@ -51,6 +54,9 @@
|
|
|
51
54
|
{
|
|
52
55
|
"path": "../../editor-palette/afm-products/tsconfig.json"
|
|
53
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"path": "../../editor-prosemirror/afm-products/tsconfig.json"
|
|
59
|
+
},
|
|
54
60
|
{
|
|
55
61
|
"path": "../../editor-shared-styles/afm-products/tsconfig.json"
|
|
56
62
|
},
|
|
@@ -6,13 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.renderExtension = exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
10
11
|
var _ExtensionRenderer = _interopRequireDefault(require("../../ui/ExtensionRenderer"));
|
|
11
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
14
|
var _consts = require("../../consts");
|
|
14
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _breakout = require("../utils/breakout");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
|
+
/**
|
|
19
|
+
* @jsxRuntime classic
|
|
20
|
+
* @jsx jsx
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
24
|
+
|
|
16
25
|
var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
17
26
|
// Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
|
|
18
27
|
var macroHeights = {
|
|
@@ -34,6 +43,9 @@ var getViewportSize = function getViewportSize(extensionId, extensionViewportSiz
|
|
|
34
43
|
return macroHeights[viewportSize];
|
|
35
44
|
}
|
|
36
45
|
};
|
|
46
|
+
var containerStyle = (0, _react.css)({
|
|
47
|
+
containerType: 'inline-size'
|
|
48
|
+
});
|
|
37
49
|
var renderExtension = exports.renderExtension = function renderExtension(content, layout) {
|
|
38
50
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
39
51
|
var removeOverflow = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -57,7 +69,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
57
69
|
var viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
58
70
|
var extensionHeight = nodeHeight || viewportSize;
|
|
59
71
|
if ((0, _expValEquals.expValEquals)('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
|
|
60
|
-
return
|
|
72
|
+
return (0, _react.jsx)("div", {
|
|
61
73
|
ref: options.handleRef
|
|
62
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
63
75
|
,
|
|
@@ -72,13 +84,15 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
72
84
|
"data-local-id": localId,
|
|
73
85
|
"data-testid": "extension--wrapper",
|
|
74
86
|
"data-node-type": "extension"
|
|
75
|
-
},
|
|
76
|
-
|
|
87
|
+
}, (0, _react.jsx)("div", {
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
89
|
+
className: overflowContainerClass,
|
|
90
|
+
css: [(0, _platformFeatureFlags.fg)('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
77
91
|
}, content));
|
|
78
92
|
}
|
|
79
|
-
return
|
|
93
|
+
return (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref2) {
|
|
80
94
|
var width = _ref2.width;
|
|
81
|
-
return
|
|
95
|
+
return (0, _react.jsx)("div", {
|
|
82
96
|
ref: options.handleRef
|
|
83
97
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
84
98
|
,
|
|
@@ -91,8 +105,10 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
91
105
|
},
|
|
92
106
|
"data-layout": layout,
|
|
93
107
|
"data-local-id": localId
|
|
94
|
-
},
|
|
95
|
-
|
|
108
|
+
}, (0, _react.jsx)("div", {
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
110
|
+
className: overflowContainerClass,
|
|
111
|
+
css: [(0, _platformFeatureFlags.fg)('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
96
112
|
}, content));
|
|
97
113
|
});
|
|
98
114
|
};
|
|
@@ -108,7 +124,7 @@ var Extension = function Extension(props) {
|
|
|
108
124
|
parameters = props.parameters,
|
|
109
125
|
nodeHeight = props.nodeHeight,
|
|
110
126
|
localId = props.localId;
|
|
111
|
-
return
|
|
127
|
+
return (0, _react.jsx)(_ExtensionRenderer.default
|
|
112
128
|
// Ignored via go/ees005
|
|
113
129
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
114
130
|
, (0, _extends2.default)({}, props, {
|
|
@@ -117,7 +133,7 @@ var Extension = function Extension(props) {
|
|
|
117
133
|
var result = _ref3.result;
|
|
118
134
|
try {
|
|
119
135
|
// Return the result directly if it's a valid JSX.Element
|
|
120
|
-
if (result && /*#__PURE__*/
|
|
136
|
+
if (result && /*#__PURE__*/_react2.default.isValidElement(result)) {
|
|
121
137
|
return renderExtension(result, layout, {
|
|
122
138
|
isTopLevel: path.length < 1,
|
|
123
139
|
handleRef: handleRef,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
/**
|
|
10
9
|
* @jsxRuntime classic
|
|
11
10
|
* @jsx jsx
|
|
@@ -13,11 +12,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
13
12
|
|
|
14
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
14
|
|
|
16
|
-
var
|
|
17
|
-
minHeight: '100px',
|
|
18
|
-
flexBasis: '100%'
|
|
19
|
-
});
|
|
20
|
-
var containerCSSNew = (0, _react.css)({
|
|
15
|
+
var containerCSS = (0, _react.css)({
|
|
21
16
|
padding: "var(--ds-space-100, 8px)",
|
|
22
17
|
minHeight: '100px',
|
|
23
18
|
// by default all frames are hidden, this style is overridden in multiBodiedExtensions for active frame
|
|
@@ -25,7 +20,7 @@ var containerCSSNew = (0, _react.css)({
|
|
|
25
20
|
});
|
|
26
21
|
var ExtensionFrame = function ExtensionFrame(props) {
|
|
27
22
|
return (0, _react.jsx)("div", {
|
|
28
|
-
css: [
|
|
23
|
+
css: [containerCSS],
|
|
29
24
|
"data-extension-frame": "true"
|
|
30
25
|
}, props.children);
|
|
31
26
|
};
|
|
@@ -160,7 +160,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
160
160
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
161
161
|
var _blockquote = _interopRequireDefault(require("./blockquote"));
|
|
162
162
|
var _bodiedExtension = _interopRequireDefault(require("./bodiedExtension"));
|
|
163
|
-
var _multiBodiedExtensionOld = _interopRequireDefault(require("./multiBodiedExtensionOld"));
|
|
164
163
|
var _multiBodiedExtension = _interopRequireDefault(require("./multiBodiedExtension"));
|
|
165
164
|
var _extensionFrame = _interopRequireDefault(require("./extensionFrame"));
|
|
166
165
|
var _bulletList = _interopRequireDefault(require("./bulletList"));
|
|
@@ -535,7 +534,7 @@ var toReact = exports.toReact = function toReact(node, flags, nodeComponents
|
|
|
535
534
|
return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
|
-
nodes['multiBodiedExtension'] =
|
|
537
|
+
nodes['multiBodiedExtension'] = _multiBodiedExtension.default;
|
|
539
538
|
return nodes[node.type.name];
|
|
540
539
|
};
|
|
541
540
|
/*
|
|
@@ -26,9 +26,11 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
|
|
|
26
26
|
getChildrenCount: function getChildrenCount() {
|
|
27
27
|
return children && Array.isArray(children) ? children.length : 0;
|
|
28
28
|
},
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
30
|
removeChild: function removeChild(_index) {
|
|
30
31
|
return false;
|
|
31
32
|
},
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
34
|
updateParameters: function updateParameters(_parameters) {
|
|
33
35
|
return false;
|
|
34
36
|
},
|
|
@@ -62,7 +62,7 @@ var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLega
|
|
|
62
62
|
width: isTopLevel ? (0, _utils.calcBreakoutWidth)(layout, width) : '100%'
|
|
63
63
|
},
|
|
64
64
|
"data-layout": layout,
|
|
65
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
65
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
66
66
|
}, (0, _react.jsx)("div", {
|
|
67
67
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
68
68
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
@@ -85,7 +85,7 @@ var MultiBodiedExtensionWrapperNext = function MultiBodiedExtensionWrapperNext(_
|
|
|
85
85
|
(0, _breakout.calcBreakoutWidthCss)(layout) : '100%'
|
|
86
86
|
},
|
|
87
87
|
"data-layout": layout,
|
|
88
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
88
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
89
89
|
}, (0, _react.jsx)("div", {
|
|
90
90
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
91
91
|
className: "".concat(_consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
@@ -69,7 +69,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
69
69
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
70
70
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
71
71
|
var packageName = "@atlaskit/renderer";
|
|
72
|
-
var packageVersion = "
|
|
72
|
+
var packageVersion = "124.19.0";
|
|
73
73
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
74
74
|
containerName: 'ak-renderer-wrapper',
|
|
75
75
|
containerType: 'inline-size'
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx, css } from '@emotion/react';
|
|
2
9
|
import React from 'react';
|
|
3
10
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
4
11
|
import { overflowShadow, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
@@ -6,6 +13,7 @@ import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
|
6
13
|
import { RendererCssClassName } from '../../consts';
|
|
7
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
15
|
import { calcBreakoutWidthCss } from '../utils/breakout';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
17
|
const viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
10
18
|
// Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
|
|
11
19
|
const macroHeights = {
|
|
@@ -25,6 +33,9 @@ const getViewportSize = (extensionId, extensionViewportSizes) => {
|
|
|
25
33
|
return macroHeights[viewportSize];
|
|
26
34
|
}
|
|
27
35
|
};
|
|
36
|
+
const containerStyle = css({
|
|
37
|
+
containerType: 'inline-size'
|
|
38
|
+
});
|
|
28
39
|
export const renderExtension = (content, layout, options = {}, removeOverflow, extensionId, extensionViewportSizes, nodeHeight, localId) => {
|
|
29
40
|
const overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
|
|
30
41
|
|
|
@@ -42,7 +53,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
42
53
|
const viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
43
54
|
const extensionHeight = nodeHeight || viewportSize;
|
|
44
55
|
if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
|
|
45
|
-
return
|
|
56
|
+
return jsx("div", {
|
|
46
57
|
ref: options.handleRef
|
|
47
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
48
59
|
,
|
|
@@ -57,13 +68,15 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
57
68
|
"data-local-id": localId,
|
|
58
69
|
"data-testid": "extension--wrapper",
|
|
59
70
|
"data-node-type": "extension"
|
|
60
|
-
},
|
|
61
|
-
|
|
71
|
+
}, jsx("div", {
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
73
|
+
className: overflowContainerClass,
|
|
74
|
+
css: [fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
62
75
|
}, content));
|
|
63
76
|
}
|
|
64
|
-
return
|
|
77
|
+
return jsx(WidthConsumer, null, ({
|
|
65
78
|
width
|
|
66
|
-
}) =>
|
|
79
|
+
}) => jsx("div", {
|
|
67
80
|
ref: options.handleRef
|
|
68
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
69
82
|
,
|
|
@@ -76,8 +89,10 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
76
89
|
},
|
|
77
90
|
"data-layout": layout,
|
|
78
91
|
"data-local-id": localId
|
|
79
|
-
},
|
|
80
|
-
|
|
92
|
+
}, jsx("div", {
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
94
|
+
className: overflowContainerClass,
|
|
95
|
+
css: [fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
81
96
|
}, content)));
|
|
82
97
|
};
|
|
83
98
|
const Extension = props => {
|
|
@@ -92,7 +107,7 @@ const Extension = props => {
|
|
|
92
107
|
nodeHeight,
|
|
93
108
|
localId
|
|
94
109
|
} = props;
|
|
95
|
-
return
|
|
110
|
+
return jsx(ExtensionRenderer
|
|
96
111
|
// Ignored via go/ees005
|
|
97
112
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
98
113
|
, _extends({}, props, {
|
|
@@ -5,12 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx, css } from '@emotion/react';
|
|
8
|
-
|
|
9
|
-
const containerCSSOld = css({
|
|
10
|
-
minHeight: '100px',
|
|
11
|
-
flexBasis: '100%'
|
|
12
|
-
});
|
|
13
|
-
const containerCSSNew = css({
|
|
8
|
+
const containerCSS = css({
|
|
14
9
|
padding: `${"var(--ds-space-100, 8px)"}`,
|
|
15
10
|
minHeight: '100px',
|
|
16
11
|
// by default all frames are hidden, this style is overridden in multiBodiedExtensions for active frame
|
|
@@ -18,7 +13,7 @@ const containerCSSNew = css({
|
|
|
18
13
|
});
|
|
19
14
|
const ExtensionFrame = props => {
|
|
20
15
|
return jsx("div", {
|
|
21
|
-
css: [
|
|
16
|
+
css: [containerCSS],
|
|
22
17
|
"data-extension-frame": "true"
|
|
23
18
|
}, props.children);
|
|
24
19
|
};
|
|
@@ -6,7 +6,6 @@ import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui'
|
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import Blockquote from './blockquote';
|
|
8
8
|
import BodiedExtension from './bodiedExtension';
|
|
9
|
-
import MultiBodiedExtensionOld from './multiBodiedExtensionOld';
|
|
10
9
|
import MultiBodiedExtension from './multiBodiedExtension';
|
|
11
10
|
import ExtensionFrame from './extensionFrame';
|
|
12
11
|
import BulletList from './bulletList';
|
|
@@ -214,7 +213,7 @@ export const toReact = (node, flags, nodeComponents
|
|
|
214
213
|
return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
nodes['multiBodiedExtension'] =
|
|
216
|
+
nodes['multiBodiedExtension'] = MultiBodiedExtension;
|
|
218
217
|
return nodes[node.type.name];
|
|
219
218
|
};
|
|
220
219
|
/*
|
|
@@ -20,9 +20,11 @@ export const useMultiBodiedExtensionActions = ({
|
|
|
20
20
|
getChildrenCount() {
|
|
21
21
|
return children && Array.isArray(children) ? children.length : 0;
|
|
22
22
|
},
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
24
|
removeChild(_index) {
|
|
24
25
|
return false;
|
|
25
26
|
},
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
28
|
updateParameters(_parameters) {
|
|
27
29
|
return false;
|
|
28
30
|
},
|
|
@@ -54,7 +54,7 @@ const MultiBodiedExtensionWrapperLegacy = ({
|
|
|
54
54
|
width: isTopLevel ? calcBreakoutWidth(layout, width) : '100%'
|
|
55
55
|
},
|
|
56
56
|
"data-layout": layout,
|
|
57
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
57
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
58
58
|
}, jsx("div", {
|
|
59
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
60
60
|
className: `${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER}`
|
|
@@ -78,7 +78,7 @@ const MultiBodiedExtensionWrapperNext = ({
|
|
|
78
78
|
calcBreakoutWidthCss(layout) : '100%'
|
|
79
79
|
},
|
|
80
80
|
"data-layout": layout,
|
|
81
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
81
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
82
82
|
}, jsx("div", {
|
|
83
83
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
84
84
|
className: `${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER}`
|
|
@@ -55,7 +55,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
55
55
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
56
56
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
57
57
|
const packageName = "@atlaskit/renderer";
|
|
58
|
-
const packageVersion = "
|
|
58
|
+
const packageVersion = "124.19.0";
|
|
59
59
|
const setAsQueryContainerStyles = css({
|
|
60
60
|
containerName: 'ak-renderer-wrapper',
|
|
61
61
|
containerType: 'inline-size'
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx, css } from '@emotion/react';
|
|
2
9
|
import React from 'react';
|
|
3
10
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
4
11
|
import { overflowShadow, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
@@ -6,6 +13,7 @@ import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
|
6
13
|
import { RendererCssClassName } from '../../consts';
|
|
7
14
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
15
|
import { calcBreakoutWidthCss } from '../utils/breakout';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
17
|
var viewportSizes = ['small', 'medium', 'default', 'large', 'xlarge'];
|
|
10
18
|
// Mirrors sizes from https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/browse/platform/packages/forge/xen-editor-provider/src/render/renderers/ForgeUIExtension.tsx
|
|
11
19
|
var macroHeights = {
|
|
@@ -27,6 +35,9 @@ var getViewportSize = function getViewportSize(extensionId, extensionViewportSiz
|
|
|
27
35
|
return macroHeights[viewportSize];
|
|
28
36
|
}
|
|
29
37
|
};
|
|
38
|
+
var containerStyle = css({
|
|
39
|
+
containerType: 'inline-size'
|
|
40
|
+
});
|
|
30
41
|
export var renderExtension = function renderExtension(content, layout) {
|
|
31
42
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
32
43
|
var removeOverflow = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -50,7 +61,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
50
61
|
var viewportSize = getViewportSize(extensionId, extensionViewportSizes);
|
|
51
62
|
var extensionHeight = nodeHeight || viewportSize;
|
|
52
63
|
if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
|
|
53
|
-
return
|
|
64
|
+
return jsx("div", {
|
|
54
65
|
ref: options.handleRef
|
|
55
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
56
67
|
,
|
|
@@ -65,13 +76,15 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
65
76
|
"data-local-id": localId,
|
|
66
77
|
"data-testid": "extension--wrapper",
|
|
67
78
|
"data-node-type": "extension"
|
|
68
|
-
},
|
|
69
|
-
|
|
79
|
+
}, jsx("div", {
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
81
|
+
className: overflowContainerClass,
|
|
82
|
+
css: [fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
70
83
|
}, content));
|
|
71
84
|
}
|
|
72
|
-
return
|
|
85
|
+
return jsx(WidthConsumer, null, function (_ref2) {
|
|
73
86
|
var width = _ref2.width;
|
|
74
|
-
return
|
|
87
|
+
return jsx("div", {
|
|
75
88
|
ref: options.handleRef
|
|
76
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
90
|
,
|
|
@@ -84,8 +97,10 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
84
97
|
},
|
|
85
98
|
"data-layout": layout,
|
|
86
99
|
"data-local-id": localId
|
|
87
|
-
},
|
|
88
|
-
|
|
100
|
+
}, jsx("div", {
|
|
101
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
102
|
+
className: overflowContainerClass,
|
|
103
|
+
css: [fg('platform_fix_macro_renders_in_layouts') && containerStyle]
|
|
89
104
|
}, content));
|
|
90
105
|
});
|
|
91
106
|
};
|
|
@@ -101,7 +116,7 @@ var Extension = function Extension(props) {
|
|
|
101
116
|
parameters = props.parameters,
|
|
102
117
|
nodeHeight = props.nodeHeight,
|
|
103
118
|
localId = props.localId;
|
|
104
|
-
return
|
|
119
|
+
return jsx(ExtensionRenderer
|
|
105
120
|
// Ignored via go/ees005
|
|
106
121
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
107
122
|
, _extends({}, props, {
|
|
@@ -5,12 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx, css } from '@emotion/react';
|
|
8
|
-
|
|
9
|
-
var containerCSSOld = css({
|
|
10
|
-
minHeight: '100px',
|
|
11
|
-
flexBasis: '100%'
|
|
12
|
-
});
|
|
13
|
-
var containerCSSNew = css({
|
|
8
|
+
var containerCSS = css({
|
|
14
9
|
padding: "var(--ds-space-100, 8px)",
|
|
15
10
|
minHeight: '100px',
|
|
16
11
|
// by default all frames are hidden, this style is overridden in multiBodiedExtensions for active frame
|
|
@@ -18,7 +13,7 @@ var containerCSSNew = css({
|
|
|
18
13
|
});
|
|
19
14
|
var ExtensionFrame = function ExtensionFrame(props) {
|
|
20
15
|
return jsx("div", {
|
|
21
|
-
css: [
|
|
16
|
+
css: [containerCSS],
|
|
22
17
|
"data-extension-frame": "true"
|
|
23
18
|
}, props.children);
|
|
24
19
|
};
|
|
@@ -9,7 +9,6 @@ import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui'
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import Blockquote from './blockquote';
|
|
11
11
|
import BodiedExtension from './bodiedExtension';
|
|
12
|
-
import MultiBodiedExtensionOld from './multiBodiedExtensionOld';
|
|
13
12
|
import MultiBodiedExtension from './multiBodiedExtension';
|
|
14
13
|
import ExtensionFrame from './extensionFrame';
|
|
15
14
|
import BulletList from './bulletList';
|
|
@@ -340,7 +339,7 @@ export var toReact = function toReact(node, flags, nodeComponents
|
|
|
340
339
|
return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
|
-
nodes['multiBodiedExtension'] =
|
|
342
|
+
nodes['multiBodiedExtension'] = MultiBodiedExtension;
|
|
344
343
|
return nodes[node.type.name];
|
|
345
344
|
};
|
|
346
345
|
/*
|
|
@@ -19,9 +19,11 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
|
|
|
19
19
|
getChildrenCount: function getChildrenCount() {
|
|
20
20
|
return children && Array.isArray(children) ? children.length : 0;
|
|
21
21
|
},
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
23
|
removeChild: function removeChild(_index) {
|
|
23
24
|
return false;
|
|
24
25
|
},
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
27
|
updateParameters: function updateParameters(_parameters) {
|
|
26
28
|
return false;
|
|
27
29
|
},
|
|
@@ -54,7 +54,7 @@ var MultiBodiedExtensionWrapperLegacy = function MultiBodiedExtensionWrapperLega
|
|
|
54
54
|
width: isTopLevel ? calcBreakoutWidth(layout, width) : '100%'
|
|
55
55
|
},
|
|
56
56
|
"data-layout": layout,
|
|
57
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
57
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
58
58
|
}, jsx("div", {
|
|
59
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
60
60
|
className: "".concat(RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
@@ -77,7 +77,7 @@ var MultiBodiedExtensionWrapperNext = function MultiBodiedExtensionWrapperNext(_
|
|
|
77
77
|
calcBreakoutWidthCss(layout) : '100%'
|
|
78
78
|
},
|
|
79
79
|
"data-layout": layout,
|
|
80
|
-
"data-testid": "multiBodiedExtension--wrapper"
|
|
80
|
+
"data-testid": "multiBodiedExtension--wrapper-renderer"
|
|
81
81
|
}, jsx("div", {
|
|
82
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
83
83
|
className: "".concat(RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
@@ -60,7 +60,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
60
60
|
// we want to calculate all the table widths (which causes reflows) after the renderer has finished loading to mitigate performance impact
|
|
61
61
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
62
62
|
var packageName = "@atlaskit/renderer";
|
|
63
|
-
var packageVersion = "
|
|
63
|
+
var packageVersion = "124.19.0";
|
|
64
64
|
var setAsQueryContainerStyles = css({
|
|
65
65
|
containerName: 'ak-renderer-wrapper',
|
|
66
66
|
containerType: 'inline-size'
|
|
@@ -148,6 +148,9 @@ type SyncedBlockFetchErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNC
|
|
|
148
148
|
type SyncedBlockGetSourceInfoErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_GET_SOURCE_INFO, {
|
|
149
149
|
error: string;
|
|
150
150
|
}>;
|
|
151
|
-
|
|
151
|
+
type ReferenceSyncedBlockUpdateErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_UPDATE, {
|
|
152
|
+
error: string;
|
|
153
|
+
}>;
|
|
154
|
+
export type AnalyticsEventPayload<_T = void> = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | HoverLabelAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | TableWidthInfoAEP | TableRendererHeightInfoAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | NestedTableTransformedAEP | MediaRenderErrorEvent | SyncedBlockFetchErrorAEP | SyncedBlockGetSourceInfoErrorAEP | ReferenceSyncedBlockUpdateErrorAEP;
|
|
152
155
|
export type FireAnalyticsCallback = <T = void>(payload: AnalyticsEventPayload<T>) => void | undefined;
|
|
153
156
|
export {};
|