@atlaskit/renderer 153.0.4 → 153.0.6
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 +16 -0
- package/dist/cjs/react/nodes/ForgeBodiedExtensionHandoff.compiled.css +4 -0
- package/dist/cjs/react/nodes/ForgeBodiedExtensionHandoff.js +63 -0
- package/dist/cjs/react/nodes/bodiedExtension.js +15 -0
- package/dist/cjs/react/nodes/forgeBodiedExtensionHandoffConfig.js +12 -0
- package/dist/cjs/react/nodes/mediaSingle/index.js +4 -5
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/ForgeBodiedExtensionHandoff.compiled.css +4 -0
- package/dist/es2019/react/nodes/ForgeBodiedExtensionHandoff.js +49 -0
- package/dist/es2019/react/nodes/bodiedExtension.js +15 -0
- package/dist/es2019/react/nodes/forgeBodiedExtensionHandoffConfig.js +6 -0
- package/dist/es2019/react/nodes/mediaSingle/index.js +5 -6
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/ForgeBodiedExtensionHandoff.compiled.css +4 -0
- package/dist/esm/react/nodes/ForgeBodiedExtensionHandoff.js +54 -0
- package/dist/esm/react/nodes/bodiedExtension.js +15 -0
- package/dist/esm/react/nodes/forgeBodiedExtensionHandoffConfig.js +6 -0
- package/dist/esm/react/nodes/mediaSingle/index.js +4 -5
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/ForgeBodiedExtensionHandoff.d.ts +13 -0
- package/dist/types/react/nodes/forgeBodiedExtensionHandoffConfig.d.ts +4 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 153.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f77206bee9f86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f77206bee9f86) -
|
|
8
|
+
Preserve the native Aura Table Filter body height until its Forge ready event, behind the
|
|
9
|
+
independent cc_aura_table_filter_cls experiment.
|
|
10
|
+
|
|
11
|
+
## 153.0.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`4cdaf1f75d6ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4cdaf1f75d6ad) -
|
|
16
|
+
Use const for stable local bindings
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 153.0.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* ForgeBodiedExtensionHandoff.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.default = ForgeBodiedExtensionHandoff;
|
|
10
|
+
require("./ForgeBodiedExtensionHandoff.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
var _bindEventListener = require("bind-event-listener");
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
var styles = {
|
|
18
|
+
container: "_1e0c11p5",
|
|
19
|
+
layer: "_nd5l1ekt _1ul9idpf",
|
|
20
|
+
reservation: "_nd5l1ekt _1ul9idpf _3um015vq _lcxvglyw"
|
|
21
|
+
};
|
|
22
|
+
/** Keep the native body in layout until Forge finishes its initial rendering. */
|
|
23
|
+
function ForgeBodiedExtensionHandoff(_ref) {
|
|
24
|
+
var fallback = _ref.fallback,
|
|
25
|
+
localId = _ref.localId,
|
|
26
|
+
result = _ref.result;
|
|
27
|
+
var _useState = (0, _react.useState)(false),
|
|
28
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
29
|
+
ready = _useState2[0],
|
|
30
|
+
setReady = _useState2[1];
|
|
31
|
+
var hasResult = Boolean(result);
|
|
32
|
+
(0, _react.useEffect)(function () {
|
|
33
|
+
if (!hasResult || ready) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
var onReady = function onReady(event) {
|
|
37
|
+
var _event$data, _event$data2, _event$data3;
|
|
38
|
+
if (event.source === window && event.origin === window.location.origin && ((_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.source) === 'forge-extension' && ((_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.type) === 'EXTENSION_READY' && ((_event$data3 = event.data) === null || _event$data3 === void 0 ? void 0 : _event$data3.localId) === localId) {
|
|
39
|
+
setReady(true);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var unbind = (0, _bindEventListener.bind)(window, {
|
|
43
|
+
type: 'message',
|
|
44
|
+
listener: onReady
|
|
45
|
+
});
|
|
46
|
+
// Do not retain an invisible body indefinitely if app initialization fails.
|
|
47
|
+
var timeout = window.setTimeout(function () {
|
|
48
|
+
return setReady(true);
|
|
49
|
+
}, 30000);
|
|
50
|
+
return function () {
|
|
51
|
+
unbind();
|
|
52
|
+
window.clearTimeout(timeout);
|
|
53
|
+
};
|
|
54
|
+
}, [hasResult, localId, ready]);
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: (0, _runtime.ax)([styles.container])
|
|
57
|
+
}, (!ready || !hasResult) && /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
"aria-hidden": hasResult || undefined,
|
|
59
|
+
className: (0, _runtime.ax)([styles.layer, hasResult && styles.reservation])
|
|
60
|
+
}, fallback), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: (0, _runtime.ax)([styles.layer])
|
|
62
|
+
}, result));
|
|
63
|
+
}
|
|
@@ -10,12 +10,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
12
12
|
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
13
|
+
var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
|
|
13
14
|
var _enums2 = require("../../analytics/enums");
|
|
14
15
|
var _annotations = require("../../ui/annotations");
|
|
15
16
|
var _ExtensionRenderer = _interopRequireDefault(require("../../ui/ExtensionRenderer"));
|
|
16
17
|
var _ErrorBoundary = require("../../ui/Renderer/ErrorBoundary");
|
|
17
18
|
var _ValidationContext = require("../../ui/Renderer/ValidationContext");
|
|
18
19
|
var _extension = require("./extension");
|
|
20
|
+
var _ForgeBodiedExtensionHandoff = _interopRequireDefault(require("./ForgeBodiedExtensionHandoff"));
|
|
21
|
+
var _forgeBodiedExtensionHandoffConfig = require("./forgeBodiedExtensionHandoffConfig");
|
|
19
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
23
|
var BodiedExtension = function BodiedExtension(props) {
|
|
21
24
|
var children = props.children,
|
|
@@ -62,6 +65,18 @@ var BodiedExtension = function BodiedExtension(props) {
|
|
|
62
65
|
}), function (_ref) {
|
|
63
66
|
var node = _ref.node,
|
|
64
67
|
result = _ref.result;
|
|
68
|
+
if (localId && extensionType === 'com.atlassian.ecosystem' && _forgeBodiedExtensionHandoffConfig.FORGE_BODIED_EXTENSION_HANDOFF_KEYS.has(extensionKey) && !(shouldDisplayExtensionAsInline !== null && shouldDisplayExtensionAsInline !== void 0 && shouldDisplayExtensionAsInline(node)) && (0, _expVal.expVal)('cc_aura_table_filter_cls', 'isEnabled', false)) {
|
|
69
|
+
return (0, _extension.renderExtension)( /*#__PURE__*/_react.default.createElement(_ForgeBodiedExtensionHandoff.default, {
|
|
70
|
+
key: localId,
|
|
71
|
+
localId: localId,
|
|
72
|
+
fallback: children,
|
|
73
|
+
result: /*#__PURE__*/_react.default.isValidElement(result) ? result : null
|
|
74
|
+
}), layout, {
|
|
75
|
+
isTopLevel: path.length < 1,
|
|
76
|
+
rendererAppearance: props.rendererAppearance,
|
|
77
|
+
fireAnalyticsEvent: fireAnalyticsEvent
|
|
78
|
+
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
79
|
+
}
|
|
65
80
|
try {
|
|
66
81
|
if (result && /*#__PURE__*/_react.default.isValidElement(result)) {
|
|
67
82
|
// Return the content directly if it's a valid JSX.Element
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FORGE_BODIED_EXTENSION_HANDOFF_KEYS = void 0;
|
|
7
|
+
/** Exact extension keys whose native body is retained until Forge reports ready.
|
|
8
|
+
* Keep this static so SSR and the first client render use the same allowlist.
|
|
9
|
+
*/
|
|
10
|
+
var FORGE_BODIED_EXTENSION_HANDOFF_KEYS = exports.FORGE_BODIED_EXTENSION_HANDOFF_KEYS = new Set([
|
|
11
|
+
// Aura Table Filter (production).
|
|
12
|
+
'7be6519f-6039-4662-a5a4-2e38f785dc0a/f9fff7f6-4e74-44eb-9de4-f0be57852570/static/table-filter']);
|
|
@@ -113,15 +113,14 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
|
113
113
|
height: height
|
|
114
114
|
});
|
|
115
115
|
}, []);
|
|
116
|
-
|
|
117
|
-
// Ignored via go/ees005
|
|
118
|
-
// eslint-disable-next-line prefer-const
|
|
119
116
|
var _media$props = media.props,
|
|
120
117
|
_media$props$width = _media$props.width,
|
|
121
|
-
|
|
118
|
+
initialWidth = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
122
119
|
_media$props$height = _media$props.height,
|
|
123
|
-
|
|
120
|
+
initialHeight = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
124
121
|
type = _media$props.type;
|
|
122
|
+
var width = initialWidth;
|
|
123
|
+
var height = initialHeight;
|
|
125
124
|
if (type === 'external') {
|
|
126
125
|
var stateWidth = externalImageDimensions.width,
|
|
127
126
|
stateHeight = externalImageDimensions.height;
|
|
@@ -80,7 +80,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
80
80
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
81
81
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
82
82
|
var packageName = "@atlaskit/renderer";
|
|
83
|
-
var packageVersion = "153.0.
|
|
83
|
+
var packageVersion = "153.0.5";
|
|
84
84
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
85
85
|
containerName: 'ak-renderer-wrapper',
|
|
86
86
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* ForgeBodiedExtensionHandoff.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import "./ForgeBodiedExtensionHandoff.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { bind } from 'bind-event-listener';
|
|
7
|
+
const styles = {
|
|
8
|
+
container: "_1e0c11p5",
|
|
9
|
+
layer: "_nd5l1ekt _1ul9idpf",
|
|
10
|
+
reservation: "_nd5l1ekt _1ul9idpf _3um015vq _lcxvglyw"
|
|
11
|
+
};
|
|
12
|
+
/** Keep the native body in layout until Forge finishes its initial rendering. */
|
|
13
|
+
export default function ForgeBodiedExtensionHandoff({
|
|
14
|
+
fallback,
|
|
15
|
+
localId,
|
|
16
|
+
result
|
|
17
|
+
}) {
|
|
18
|
+
const [ready, setReady] = useState(false);
|
|
19
|
+
const hasResult = Boolean(result);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!hasResult || ready) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const onReady = event => {
|
|
25
|
+
var _event$data, _event$data2, _event$data3;
|
|
26
|
+
if (event.source === window && event.origin === window.location.origin && ((_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.source) === 'forge-extension' && ((_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.type) === 'EXTENSION_READY' && ((_event$data3 = event.data) === null || _event$data3 === void 0 ? void 0 : _event$data3.localId) === localId) {
|
|
27
|
+
setReady(true);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const unbind = bind(window, {
|
|
31
|
+
type: 'message',
|
|
32
|
+
listener: onReady
|
|
33
|
+
});
|
|
34
|
+
// Do not retain an invisible body indefinitely if app initialization fails.
|
|
35
|
+
const timeout = window.setTimeout(() => setReady(true), 30000);
|
|
36
|
+
return () => {
|
|
37
|
+
unbind();
|
|
38
|
+
window.clearTimeout(timeout);
|
|
39
|
+
};
|
|
40
|
+
}, [hasResult, localId, ready]);
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: ax([styles.container])
|
|
43
|
+
}, (!ready || !hasResult) && /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
"aria-hidden": hasResult || undefined,
|
|
45
|
+
className: ax([styles.layer, hasResult && styles.reservation])
|
|
46
|
+
}, fallback), /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: ax([styles.layer])
|
|
48
|
+
}, result));
|
|
49
|
+
}
|
|
@@ -2,12 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
4
4
|
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
|
+
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
5
6
|
import { ACTION_SUBJECT } from '../../analytics/enums';
|
|
6
7
|
import { AnnotationsPositionContext } from '../../ui/annotations';
|
|
7
8
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
8
9
|
import { ErrorBoundary } from '../../ui/Renderer/ErrorBoundary';
|
|
9
10
|
import { ValidationContextProvider } from '../../ui/Renderer/ValidationContext';
|
|
10
11
|
import { renderExtension } from './extension';
|
|
12
|
+
import ForgeBodiedExtensionHandoff from './ForgeBodiedExtensionHandoff';
|
|
13
|
+
import { FORGE_BODIED_EXTENSION_HANDOFF_KEYS } from './forgeBodiedExtensionHandoffConfig';
|
|
11
14
|
const BodiedExtension = props => {
|
|
12
15
|
const {
|
|
13
16
|
children,
|
|
@@ -51,6 +54,18 @@ const BodiedExtension = props => {
|
|
|
51
54
|
node,
|
|
52
55
|
result
|
|
53
56
|
}) => {
|
|
57
|
+
if (localId && extensionType === 'com.atlassian.ecosystem' && FORGE_BODIED_EXTENSION_HANDOFF_KEYS.has(extensionKey) && !(shouldDisplayExtensionAsInline !== null && shouldDisplayExtensionAsInline !== void 0 && shouldDisplayExtensionAsInline(node)) && expVal('cc_aura_table_filter_cls', 'isEnabled', false)) {
|
|
58
|
+
return renderExtension( /*#__PURE__*/React.createElement(ForgeBodiedExtensionHandoff, {
|
|
59
|
+
key: localId,
|
|
60
|
+
localId: localId,
|
|
61
|
+
fallback: children,
|
|
62
|
+
result: /*#__PURE__*/React.isValidElement(result) ? result : null
|
|
63
|
+
}), layout, {
|
|
64
|
+
isTopLevel: path.length < 1,
|
|
65
|
+
rendererAppearance: props.rendererAppearance,
|
|
66
|
+
fireAnalyticsEvent
|
|
67
|
+
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
68
|
+
}
|
|
54
69
|
try {
|
|
55
70
|
if (result && /*#__PURE__*/React.isValidElement(result)) {
|
|
56
71
|
// Return the content directly if it's a valid JSX.Element
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Exact extension keys whose native body is retained until Forge reports ready.
|
|
2
|
+
* Keep this static so SSR and the first client render use the same allowlist.
|
|
3
|
+
*/
|
|
4
|
+
export const FORGE_BODIED_EXTENSION_HANDOFF_KEYS = new Set([
|
|
5
|
+
// Aura Table Filter (production).
|
|
6
|
+
'7be6519f-6039-4662-a5a4-2e38f785dc0a/f9fff7f6-4e74-44eb-9de4-f0be57852570/static/table-filter']);
|
|
@@ -100,14 +100,13 @@ const MediaSingleWithChildren = props => {
|
|
|
100
100
|
height
|
|
101
101
|
});
|
|
102
102
|
}, []);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
let {
|
|
107
|
-
width = DEFAULT_WIDTH,
|
|
108
|
-
height = DEFAULT_HEIGHT,
|
|
103
|
+
const {
|
|
104
|
+
width: initialWidth = DEFAULT_WIDTH,
|
|
105
|
+
height: initialHeight = DEFAULT_HEIGHT,
|
|
109
106
|
type
|
|
110
107
|
} = media.props;
|
|
108
|
+
let width = initialWidth;
|
|
109
|
+
let height = initialHeight;
|
|
111
110
|
if (type === 'external') {
|
|
112
111
|
const {
|
|
113
112
|
width: stateWidth,
|
|
@@ -65,7 +65,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
65
65
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
66
66
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
67
67
|
const packageName = "@atlaskit/renderer";
|
|
68
|
-
const packageVersion = "153.0.
|
|
68
|
+
const packageVersion = "153.0.5";
|
|
69
69
|
const setAsQueryContainerStyles = css({
|
|
70
70
|
containerName: 'ak-renderer-wrapper',
|
|
71
71
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* ForgeBodiedExtensionHandoff.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import "./ForgeBodiedExtensionHandoff.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { bind } from 'bind-event-listener';
|
|
8
|
+
var styles = {
|
|
9
|
+
container: "_1e0c11p5",
|
|
10
|
+
layer: "_nd5l1ekt _1ul9idpf",
|
|
11
|
+
reservation: "_nd5l1ekt _1ul9idpf _3um015vq _lcxvglyw"
|
|
12
|
+
};
|
|
13
|
+
/** Keep the native body in layout until Forge finishes its initial rendering. */
|
|
14
|
+
export default function ForgeBodiedExtensionHandoff(_ref) {
|
|
15
|
+
var fallback = _ref.fallback,
|
|
16
|
+
localId = _ref.localId,
|
|
17
|
+
result = _ref.result;
|
|
18
|
+
var _useState = useState(false),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
ready = _useState2[0],
|
|
21
|
+
setReady = _useState2[1];
|
|
22
|
+
var hasResult = Boolean(result);
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
if (!hasResult || ready) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var onReady = function onReady(event) {
|
|
28
|
+
var _event$data, _event$data2, _event$data3;
|
|
29
|
+
if (event.source === window && event.origin === window.location.origin && ((_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.source) === 'forge-extension' && ((_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.type) === 'EXTENSION_READY' && ((_event$data3 = event.data) === null || _event$data3 === void 0 ? void 0 : _event$data3.localId) === localId) {
|
|
30
|
+
setReady(true);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var unbind = bind(window, {
|
|
34
|
+
type: 'message',
|
|
35
|
+
listener: onReady
|
|
36
|
+
});
|
|
37
|
+
// Do not retain an invisible body indefinitely if app initialization fails.
|
|
38
|
+
var timeout = window.setTimeout(function () {
|
|
39
|
+
return setReady(true);
|
|
40
|
+
}, 30000);
|
|
41
|
+
return function () {
|
|
42
|
+
unbind();
|
|
43
|
+
window.clearTimeout(timeout);
|
|
44
|
+
};
|
|
45
|
+
}, [hasResult, localId, ready]);
|
|
46
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: ax([styles.container])
|
|
48
|
+
}, (!ready || !hasResult) && /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
"aria-hidden": hasResult || undefined,
|
|
50
|
+
className: ax([styles.layer, hasResult && styles.reservation])
|
|
51
|
+
}, fallback), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: ax([styles.layer])
|
|
53
|
+
}, result));
|
|
54
|
+
}
|
|
@@ -2,12 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
4
4
|
import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
|
+
import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
|
|
5
6
|
import { ACTION_SUBJECT } from '../../analytics/enums';
|
|
6
7
|
import { AnnotationsPositionContext } from '../../ui/annotations';
|
|
7
8
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
8
9
|
import { ErrorBoundary } from '../../ui/Renderer/ErrorBoundary';
|
|
9
10
|
import { ValidationContextProvider } from '../../ui/Renderer/ValidationContext';
|
|
10
11
|
import { renderExtension } from './extension';
|
|
12
|
+
import ForgeBodiedExtensionHandoff from './ForgeBodiedExtensionHandoff';
|
|
13
|
+
import { FORGE_BODIED_EXTENSION_HANDOFF_KEYS } from './forgeBodiedExtensionHandoffConfig';
|
|
11
14
|
var BodiedExtension = function BodiedExtension(props) {
|
|
12
15
|
var children = props.children,
|
|
13
16
|
_props$layout = props.layout,
|
|
@@ -53,6 +56,18 @@ var BodiedExtension = function BodiedExtension(props) {
|
|
|
53
56
|
}), function (_ref) {
|
|
54
57
|
var node = _ref.node,
|
|
55
58
|
result = _ref.result;
|
|
59
|
+
if (localId && extensionType === 'com.atlassian.ecosystem' && FORGE_BODIED_EXTENSION_HANDOFF_KEYS.has(extensionKey) && !(shouldDisplayExtensionAsInline !== null && shouldDisplayExtensionAsInline !== void 0 && shouldDisplayExtensionAsInline(node)) && expVal('cc_aura_table_filter_cls', 'isEnabled', false)) {
|
|
60
|
+
return renderExtension( /*#__PURE__*/React.createElement(ForgeBodiedExtensionHandoff, {
|
|
61
|
+
key: localId,
|
|
62
|
+
localId: localId,
|
|
63
|
+
fallback: children,
|
|
64
|
+
result: /*#__PURE__*/React.isValidElement(result) ? result : null
|
|
65
|
+
}), layout, {
|
|
66
|
+
isTopLevel: path.length < 1,
|
|
67
|
+
rendererAppearance: props.rendererAppearance,
|
|
68
|
+
fireAnalyticsEvent: fireAnalyticsEvent
|
|
69
|
+
}, removeOverflow, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, undefined, localId, shouldDisplayExtensionAsInline, node);
|
|
70
|
+
}
|
|
56
71
|
try {
|
|
57
72
|
if (result && /*#__PURE__*/React.isValidElement(result)) {
|
|
58
73
|
// Return the content directly if it's a valid JSX.Element
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Exact extension keys whose native body is retained until Forge reports ready.
|
|
2
|
+
* Keep this static so SSR and the first client render use the same allowlist.
|
|
3
|
+
*/
|
|
4
|
+
export var FORGE_BODIED_EXTENSION_HANDOFF_KEYS = new Set([
|
|
5
|
+
// Aura Table Filter (production).
|
|
6
|
+
'7be6519f-6039-4662-a5a4-2e38f785dc0a/f9fff7f6-4e74-44eb-9de4-f0be57852570/static/table-filter']);
|
|
@@ -104,15 +104,14 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
|
104
104
|
height: height
|
|
105
105
|
});
|
|
106
106
|
}, []);
|
|
107
|
-
|
|
108
|
-
// Ignored via go/ees005
|
|
109
|
-
// eslint-disable-next-line prefer-const
|
|
110
107
|
var _media$props = media.props,
|
|
111
108
|
_media$props$width = _media$props.width,
|
|
112
|
-
|
|
109
|
+
initialWidth = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
113
110
|
_media$props$height = _media$props.height,
|
|
114
|
-
|
|
111
|
+
initialHeight = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
115
112
|
type = _media$props.type;
|
|
113
|
+
var width = initialWidth;
|
|
114
|
+
var height = initialHeight;
|
|
116
115
|
if (type === 'external') {
|
|
117
116
|
var stateWidth = externalImageDimensions.width,
|
|
118
117
|
stateHeight = externalImageDimensions.height;
|
|
@@ -70,7 +70,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
70
70
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
71
71
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
72
72
|
var packageName = "@atlaskit/renderer";
|
|
73
|
-
var packageVersion = "153.0.
|
|
73
|
+
var packageVersion = "153.0.5";
|
|
74
74
|
var setAsQueryContainerStyles = css({
|
|
75
75
|
containerName: 'ak-renderer-wrapper',
|
|
76
76
|
containerType: 'inline-size'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
6
|
+
interface Props {
|
|
7
|
+
fallback: ReactNode;
|
|
8
|
+
localId: string;
|
|
9
|
+
result: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** Keep the native body in layout until Forge finishes its initial rendering. */
|
|
12
|
+
export default function ForgeBodiedExtensionHandoff({ fallback, localId, result, }: Props): ReactElement;
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "153.0.
|
|
3
|
+
"version": "153.0.6",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"@atlaskit/modal-dialog": "^17.1.0",
|
|
116
116
|
"@atlaskit/navigation-system": "^11.4.0",
|
|
117
117
|
"@atlaskit/primitives": "^22.6.0",
|
|
118
|
-
"@atlaskit/profilecard": "^27.
|
|
118
|
+
"@atlaskit/profilecard": "^27.4.0",
|
|
119
119
|
"@atlaskit/radio": "^10.2.0",
|
|
120
120
|
"@atlaskit/range": "^12.2.0",
|
|
121
121
|
"@atlaskit/section-message": "^10.2.0",
|
|
122
122
|
"@atlaskit/side-nav-items": "^2.6.0",
|
|
123
|
-
"@atlaskit/textfield": "^10.
|
|
123
|
+
"@atlaskit/textfield": "^10.3.0",
|
|
124
124
|
"@atlaskit/toggle": "^17.3.0",
|
|
125
125
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
126
126
|
"@atlaskit/width-detector": "^7.2.0",
|