@atlaskit/renderer 153.0.5 → 153.0.7
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 +17 -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/extension.js +1 -1
- package/dist/cjs/react/nodes/forgeBodiedExtensionHandoffConfig.js +12 -0
- package/dist/cjs/react/utils/markBlockAsInline.js +1 -2
- 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/extension.js +1 -1
- package/dist/es2019/react/nodes/forgeBodiedExtensionHandoffConfig.js +6 -0
- package/dist/es2019/react/utils/markBlockAsInline.js +1 -2
- 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/extension.js +1 -1
- package/dist/esm/react/nodes/forgeBodiedExtensionHandoffConfig.js +6 -0
- package/dist/esm/react/utils/markBlockAsInline.js +1 -2
- 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 +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 153.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`55f011a1eafc7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55f011a1eafc7) -
|
|
8
|
+
Remove `platform_forge_inline_bodied_layout_switch` and retain support for inline-bodied macro
|
|
9
|
+
layouts permanently.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 153.0.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`f77206bee9f86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f77206bee9f86) -
|
|
17
|
+
Preserve the native Aura Table Filter body height until its Forge ready event, behind the
|
|
18
|
+
independent cc_aura_table_filter_cls experiment.
|
|
19
|
+
|
|
3
20
|
## 153.0.5
|
|
4
21
|
|
|
5
22
|
### 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
|
|
@@ -128,7 +128,7 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
128
128
|
* available signal.
|
|
129
129
|
*/
|
|
130
130
|
var hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 || (_node$parameters = node.parameters) === null || _node$parameters === void 0 || (_node$parameters = _node$parameters.guestParams) === null || _node$parameters === void 0 ? void 0 : _node$parameters[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
131
|
-
var isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 || (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied'
|
|
131
|
+
var isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 || (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied';
|
|
132
132
|
/**
|
|
133
133
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
134
134
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -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']);
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.markBlockAsInline = markBlockAsInline;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
10
9
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
11
10
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
11
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -22,7 +21,7 @@ function markBlockAsInline(_ref) {
|
|
|
22
21
|
}
|
|
23
22
|
function isInlineBodiedExtension(node) {
|
|
24
23
|
var _node$attrs, _node$attrs2, _node$attrs3, _node$attrs4, _node$attrs5, _node$attrs6;
|
|
25
|
-
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.layout) === 'inline-bodied'
|
|
24
|
+
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.layout) === 'inline-bodied') {
|
|
26
25
|
return false;
|
|
27
26
|
}
|
|
28
27
|
return Boolean((node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && shouldDisplayExtensionAsInline({
|
|
@@ -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.6";
|
|
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
|
|
@@ -105,7 +105,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
105
105
|
* available signal.
|
|
106
106
|
*/
|
|
107
107
|
const hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 ? void 0 : (_node$parameters = node.parameters) === null || _node$parameters === void 0 ? void 0 : (_node$parameters$gues = _node$parameters.guestParams) === null || _node$parameters$gues === void 0 ? void 0 : _node$parameters$gues[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
108
|
-
const isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 ? void 0 : (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied'
|
|
108
|
+
const isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 ? void 0 : (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied';
|
|
109
109
|
/**
|
|
110
110
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
111
111
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -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']);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
1
|
export function markBlockAsInline({
|
|
3
2
|
nodes,
|
|
4
3
|
onMark,
|
|
@@ -11,7 +10,7 @@ export function markBlockAsInline({
|
|
|
11
10
|
}
|
|
12
11
|
function isInlineBodiedExtension(node) {
|
|
13
12
|
var _node$attrs, _node$attrs2, _node$attrs2$paramete, _node$attrs3, _node$attrs4, _node$attrs5, _node$attrs6;
|
|
14
|
-
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : _node$attrs2$paramete.layout) === 'inline-bodied'
|
|
13
|
+
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : _node$attrs2$paramete.layout) === 'inline-bodied') {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
17
16
|
return Boolean((node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && shouldDisplayExtensionAsInline({
|
|
@@ -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.6";
|
|
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
|
|
@@ -121,7 +121,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
121
121
|
* available signal.
|
|
122
122
|
*/
|
|
123
123
|
var hasForgeInlineBodiedMarker = Boolean((node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.content) && (node === null || node === void 0 || (_node$parameters = node.parameters) === null || _node$parameters === void 0 || (_node$parameters = _node$parameters.guestParams) === null || _node$parameters === void 0 ? void 0 : _node$parameters[FORGE_INLINE_BODIED_PARAM]) === 'true');
|
|
124
|
-
var isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 || (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied'
|
|
124
|
+
var isInlineBodiedLayoutEnabled = (node === null || node === void 0 ? void 0 : node.extensionType) === FORGE_EXTENSION_TYPE && (node === null || node === void 0 ? void 0 : node.type) === 'bodiedExtension' && (node === null || node === void 0 || (_node$parameters2 = node.parameters) === null || _node$parameters2 === void 0 ? void 0 : _node$parameters2.layout) === 'inline-bodied';
|
|
125
125
|
/**
|
|
126
126
|
* The pass that marks the sibling textblocks around an inline extension resolves their
|
|
127
127
|
* positions without a depth term, so it only ever matches at the top level. Inlining a nested
|
|
@@ -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']);
|
|
@@ -2,7 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
5
|
export function markBlockAsInline(_ref) {
|
|
7
6
|
var nodes = _ref.nodes,
|
|
8
7
|
onMark = _ref.onMark,
|
|
@@ -15,7 +14,7 @@ export function markBlockAsInline(_ref) {
|
|
|
15
14
|
}
|
|
16
15
|
function isInlineBodiedExtension(node) {
|
|
17
16
|
var _node$attrs, _node$attrs2, _node$attrs3, _node$attrs4, _node$attrs5, _node$attrs6;
|
|
18
|
-
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.layout) === 'inline-bodied'
|
|
17
|
+
if (!isTopLevel && (node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType) === 'com.atlassian.ecosystem' && ((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.layout) === 'inline-bodied') {
|
|
19
18
|
return false;
|
|
20
19
|
}
|
|
21
20
|
return Boolean((node === null || node === void 0 ? void 0 : node.type.name) === 'bodiedExtension' && shouldDisplayExtensionAsInline({
|
|
@@ -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.6";
|
|
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.7",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -120,7 +120,7 @@
|
|
|
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",
|
|
@@ -212,10 +212,6 @@
|
|
|
212
212
|
},
|
|
213
213
|
"platform_nested_table_style_override_2": {
|
|
214
214
|
"type": "boolean"
|
|
215
|
-
},
|
|
216
|
-
"platform_forge_inline_bodied_layout_switch": {
|
|
217
|
-
"type": "boolean",
|
|
218
|
-
"referenceOnly": true
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
217
|
}
|